Transpose Columns to Rows in Oracle

WITH all_objects_data AS (
select * from table1 where id = xyz
)
SELECT column_name , column_value FROM all_objects_data
UNPIVOT (column_value
FOR column_name
IN (col1,col2));

-o-
*****
http://www.dba-oracle.com/t_converting_rows_columns.htm

http://boostips.blogspot.com/2012/05/transpose-column-value-to-row-in-oracle.html
http://www.oracle-developer.net/display.php?id=506

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s