Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: compress group-by

Re: compress group-by

From: Michel Cadot <micadot{at}altern{dot}org>
Date: Mon, 12 Jul 2004 17:39:30 +0200
Message-ID: <40f2b036$0$6169$626a14ce@news.free.fr>

"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 Cadot
Received on Mon Jul 12 2004 - 10:39:30 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US