yogesh_vaidya12 0 Newbie Poster
SELECT NetAmout FROM  MONTHLYBILLS WHERE REGNO = '047080809' 
 AND TRUNC(BILLDATE) BETWEEN '01-AUG-2008' AND '30-AUG-2008'

In above Query written 4 rows in which 3 rows showing netamount 0 and last 4 row showing netamout 4200.

SELECT   DECODE( SIGN(SUM(NETAMOUNT)),0,0)
    FROM ALMONTHLYBILLS WHERE NETAMOUNT NOT  IN (SELECT  DECODE( SIGN(SUM(NETAMOUNT)),1,0)  FROM MONTHLYBILLS ))

In my Main Query I am trying out the case in which if sum of net amount is zero
then all recods shows but sum of netamount is nonzero then it will not shows those recods which netamount is zero.