Hello
I have a SQL like this;
SELECT
..........
.........
(CASE WHEN GECIKME_CV(:TAR,B.HESAP_NO, 90, 9999, B.DOVIZ_KOD) > 0 THEN 100 ELSE 0 END) AS PROV,
.......
.......
FROM S_TEKLIF B
WHERE .........
..........
GROUP BY ........., ........, (CASE WHEN GECIKME_CV(:TAR,B.HESAP_NO, 90, 9999, B.DOVIZ_KOD) > 0 THEN 100 ELSE 0 END),......
I want to change this SQL like this;
SELECT
..........
.........
(CASE WHEN GECIKME_CV(:TAR,B.HESAP_NO, 90, 9999, B.DOVIZ_KOD) > 0 THEN 100 WHEN B.HESAP_NO IN (SELECT HESAP_NO FROM S_TAKIP_MUSTERI) THEN 100 ELSE 0 END) AS PROV,
.........
FROM S_TEKLIF B
WHERE .........
..........
GROUP BY ........., ........, (CASE WHEN GECIKME_CV(:TAR,B.HESAP_NO, 90, 9999, B.DOVIZ_KOD) > 0 THEN 100 WHEN B.HESAP_NO IN (SELECT HESAP_NO FROM S_TAKIP_MUSTERI) THEN 100 ELSE 0 END),......
But this query doesn't work. Getting a GROUP BY error.
I attach my full code this post
SQL Group By Error
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

CrishRank #1,486 · 1.1K reputationPosted Apr 5, 2011, 3:15 AM EDT
Suthish NairRank #92 · 22.8K reputationPosted Apr 6, 2011, 7:39 AM EDT