Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: rollup in 8.1.5 (sums at top?)
Can't you use DECODE on the GROUPING function in an ORDER BY or a HAVING
clause?
The expr in the GROUPING function must match one of the expressions in the GROUP BY clause. The function returns a value of 1 if the value of expr in the row is a null representing the set of all values. Otherwise, it returns zero.
HTH. Finn
L8tr0n <l8tr0n_at_my-deja.com> wrote in message
news:87sjnk$uco$1_at_nnrp1.deja.com...
> I have been using the rollup grouping in 8.1.5
>
> It makes nice little subtotals for me..
>
> YEAR REGION SUM(PROFIT) COUNT(*)
> ---------- ------- ----------- ----------
> 1995 Central 100 1
> 1995 East 200 2
> 1995 West 200 2
> 1995 500 5
> 1996 West 200 2
> 1996 200 2
> 700 7
>
> See how the sub totals are inserted after the detail the "normal way"
> Well I need the grand total and the subtotals to come BEFORE the detail
> it is subtotaling. why? just cuz..
> If I run a order by desc.. EVERYTHING is reversed.. meaning that the
> detail rows are also in reverse order.. I don't want this.. Is there
> ANY way I can achieve this result?
>
> YEAR REGION SUM(PROFIT) COUNT(*)
> ---------- ------- ----------- ----------
> 700 7
> 1995 500 5
> 1995 Central 100 1
> 1995 East 200 2
> 1995 West 200 2
> 1996 200 2
> 1996 West 200 2
>
> Suggestions?
>
>
> -Ken
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Wed Feb 23 2000 - 15:59:00 CST
![]() |
![]() |