I have a SQL like this below
SELECT A.UNIT, A.PO_NO, A.LINE, A.QUNATITY,
SUM(B.RECEIVED_QUNATITY) AS "RECEIVED QUANTITY"
FROM PO_TBL A, RECEIVER_TBL B
WHERE A.UNIT = B.UNIT AND A.PO_NO = B.PO_NO AND A.LINE = B.LINE
GROUP BY A.UNIT, A.PO_NO, A.LINE, A.QUNATITY
HAVING ((A.QUNATITY - SUM(B.RECEIVED_QUNATITY)) > 0);
The above SQL return more rows if the Having
function is not used and returns null rows, when we using Having
function. Even though, Quantity has value as "10" and RECEIVED_QUNATITY
has value as "0", that rows are not shown in the output.
Kindly help me on this scenario......