Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: compress group-by
"hastenthunder" <hastenthunder_at_hotmail.com> a écrit dans le message de
news:_%xIc.605$Ny6.1628_at_mencken.net.nih.gov...
> Hi SQL Masters,
>
> Is there a way to compress multiple rows returned from group-by query into a
> single row? (such as compress results before 1990)
> The result should look something like:
>
> Result
> ----------------------------------------
> Before 1990 89766
> 1991 1000
> 1992 2000
> 1993 2200
> ...
>
>
> Thanks a lot
>
> HastenThunder
>
>
Something like:
group by decode(sign(year-1990),1,year,'Before 1990')
-- Regards Michel CadotReceived on Mon Jul 12 2004 - 10:39:30 CDT
![]() |
![]() |