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: Group by year, display years as columns?

Re: Group by year, display years as columns?

From: Maxim Demenko <mdemenko_at_gmail.com>
Date: Thu, 26 May 2005 17:57:38 +0200
Message-ID: <d74rlf$mr0$00$1@news.t-online.com>


NetComrade schrieb:
> All,
>
> Is there are a way do something like?
>
> select trunc(by_date, 'yyyy'), count(*)
> from my_table
> group by trunc(by_date,'yyyy')
> where by_date between last_year, this_year
>
> but to display the resultant years in columns (years will be limited,
> columns will be known in advance).
>
> 1) is there are a straighforward way to do this?
> 2) I recall I've read some transformation doc (how to make
> rows->columns) on metalink, but I can't find it
>
> Thanks!
> ........
> We use Oracle 8.1.7.4 and 9.2.0.5 on Solaris 2.7 boxes
> remove NSPAM to email

http://asktom.oracle.com/pls/ask/f?p=4950:8:826215962454476266::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:766825833740,

Best regards

Maxim Received on Thu May 26 2005 - 10:57:38 CDT

Original text of this message

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