Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Group by year, display years as columns?
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).
Thanks!
.......
We use Oracle 8.1.7.4 and 9.2.0.5 on Solaris 2.7 boxes
remove NSPAM to email
Received on Thu May 26 2005 - 09:56:36 CDT