Check condition based on group by query!!!
I have a query that returns sum amount for a specific transaction.
select drvr_num, sum(amount)
where transaction_type = 'CLMR'
group by oracle_drvr_num
The thing is I don't want to display the rows with 0 amount. I have a table with mulitple record for each driver with positive and negative amount. So when I sum it, it gives me the sum amount with zeroes as well, for example they may have -50 and +50, it comes out to be zero and I don't want those rows. Is there a way to do this in a subquery. I have to create a report for it in Reports 6i and I tried using the formula but it returns each row multiple times. I thought there might be a solution if i try writing a subquery. Thanks.
Add the line:
having sum(amount) <> 0
as the last line (and correct the typo).
yeah man, i just tried that as I was reading the book. Thanks for helping me.
Click Here to Expand Forum to Full Width