here's my query:
select name, sum(case when amount<0 then 0 else amount end) as total_amount from table group by name
notes: amounts are either positive or negative
the sum in the above query results in the wrong total, which i can't figure out. when i look at the raw data to validate the results it's not right. Can anyone help without actually seeing the data?
Thank you! :)