Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: how do I combine 24 rows(3 columns) into one row (
Hi!
I'm not sure you really want do do this in SQL. The number of columns is a static property of a SQL query.
So, do you know that there always are 24 rows in your table? If so, you'll end up with a clumsy query á la
select
tab1.hour hour1, tab2.hour hour2, tab3.hour hour3,
hourtable tab1, hourtable tab2, hourtable tab3,
tab1.rowid < tab2.rowid and tab2.rowid < tab3.rowid and tab3.rowid < tab4.rowid and
If the number of rows in your table is dynamic; can't do. Try exporting to a spreadsheet and do a transpose there instead.
HTH,
Roy Brokvam
roy.brokvam_at_conax.com
Received on Fri Feb 19 1999 - 00:40:45 CST