Subject | Re: Summiing Amounts |
---|---|
Author | Svein Erling Tysvær |
Post date | 2005-12-01T11:25:02Z |
> select datecolumn, item,Uh, oh, slight mistake:
> sum(case when amount > 0 then amount else 0) as posamt,
> sum(case when amount < 0 then -amount else 0) as negamt
> group by datecolumn, item
select datecolumn, item,
sum(case when amount > 0 then amount else 0 end) as posamt,
sum(case when amount < 0 then -amount else 0 end) as negamt
group by datecolumn, item
Sorry,
Set