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!

Another Simple Pivot question - rotate text column to row

Mr NeilJun 20 2016 — edited Jun 21 2016

Hi guys,

Stuck again.  Just can't get my head around these pivots. Oracle 11g.

I need to pivot 3 rows up to 3 columns with a varying number of row items. It's the varying amount of column-to-be data that I'm having trouble with

Source   

IDRECORD_NUMBERITEMSQTY
1100widget_69100
2101widget_70150
3101widget_71200
4102widget_72250
5102widget_73300
6102widget_74350

The Target   

RECORD_NUMBERITEM_1QTY_1ITEM_2QTY_2ITEM_3QTY_3
100widget_69100
101widget_70150widget_71200
102widget_72250widget_73300widget_74350

Any help appreciated.

NT

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jul 19 2016
Added on Jun 20 2016
8 comments
290 views