How much data do you have? I think it would be easiest to just spool the
original contents to a text file, then import that file into Excel and
do the transposing there.
-----Original Message-----
From: Mahesh Naralkar
[mailto:oracledba-ezmlmshield-x3953061.[Email address protected]
Sent: Wednesday, July 26, 2006 10:33 PM
To: LazyDBA Discussion
Subject: Transpose Rows into columns
Hi,
I want to to transpose rows into columns dynamically.
For ex.
SQL> select deptno, dname from dept;
DEPTNO DNAME
---------- --------------
10 ACCOUNTING
20 RESEARCH
30 SALES
40 OPERATIONS
I want the result as
10 20 30 40
ACCOUNTING RESEARCH SALES OPERATIONS
whithout hardcoding the column names.
These row may get increased. As row get inserted a new column will also
get generated dynamically.
Suppose there are 50 rows the query will show me the 50 columns in
result
Regards,
Mahesh
--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com
To unsubscribe: see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com
By using this list you agree to these
terms:http://www.lazydba.com/legal.html
Oracle LazyDBA home page