Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL Query: Switching Rows to Columns dynamically.
Hi;
I know this is NOT strictly an SQL answer, but I have just done this using Perl.
I do cheat in the SQL by ||'!'|| each of the columns into one wide "set
lines 5000" row per row set.
Then a simple perl script to "pivot" all this into a nice tall Excel
sheet for my user(s).
Perl is basically :-
While (<>){
read each line into an array
}
{
Foreach column
foreach row print cell
I currently pivot over 300 columns into no more than 25 rows using
"where ... and rownum < 25"
Made my life much easier, and my butt shines!!
I even union'ed an header row so users can see each named Excel row.
Sorry if this is no help. Just my bit to the list.
Regards
Ian
Received on Tue Oct 17 2006 - 07:45:09 CDT