Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Convert rows to columns where all data is TEXT (no aggregation)

pepperbrOct 8 2020

How do I convert name/value pair data in rows to columns?

Sample values in a query result set:
ID NAME VALUE
----- --------------- -----------------------
First Red Value1
First Blue Value2
First Green Value3
Third Red Value4
Third Blue Value5
Third Green Value6

Desired result set:
ID RED BLUE GREEN
------ ---------- --------- -----------
First Value1 Value2 Value3
Third Value4 Value5 Value6

Comments

Post Details

Added on Oct 8 2020
4 comments
2,573 views