Good morning, I'm scheduling this query:
SELECT t1.percod permisor, t1.pernom ciudad,
t2.abocod cod_abonado, t2.abonom1 nombre, t2.aboape1 apellido,
t2.abosts, t2.abocmsts, t2.abotlfsts, t2.aboipsts,
t3.recicod, t3.recifch, t3.reciimp monto_recibo,
(t3.reciimp - sum(t4.recifacimp)) monto_sin_aplicar
FROM gx.permis t1,
gx.abonad t2,
gx.recibo t3,
gx.recide t4
WHERE t1.percod = t2.percod
AND t2.percod = t3.percod
AND t2.abocod = t3.abocod
AND t3.percod = t4.percod
AND t3.recicod = t4.recicod
GROUP BY t1.percod, t1.pernom, t2.abocod, t2.abonom1, t2.aboape1, t2.abosts, t2.abocmsts,t2.abotlfsts, t2.aboipsts, t2.abodthsts, t3.recicod, t3.recifch, t3.reciimp;
What I need is that the query does not show those data where (t3.reciimp - sum(t4.recifacimp))
equals zero (0) ... I tried adding
AND (t3.reciimp - sum(t4.recifacimp)) <> 0
but gives this error:
ORA-00934: group function not allowed here 00934. 00000 - "group function is not allowed here" * Cause:
* Action: Error in the line: 19, column: 23
How do I resolve that error?