Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL to compute sums (similar to SQL*plus break on <column> compute sum of <other_col> on <column>)
On 29 Nov 2001, andreyNSPAM_at_bookexchange.net (NetComrade)
spake and said:
> I know there is some 'new' SQL that can do this, but can't
> think of a way to look for it. Although not sure which
> version it was introduced in 8i or 9i.
Not sure what your look for, but it might be this:
select yyyy , mmm , dd , sum(amount_sold) amount_sold
compute sum(sum(amount_sold)) by yyyy,mmm compute sum(sum(amount_sold)) by yyyy compute sum(sum(amount_sold))
Not exactly 'new' SQL, but it will give you subtotals and totals at every sequence break.
--Received on Fri Nov 30 2001 - 13:22:13 CST