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