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!

Transpose data from rows to columns

TknightJun 7 2018 — edited Jun 7 2018

Hello, Need help!

My table has 2 columns and values it will store are similar to the below one

pastedImage_0.png

I need to transpose the values in optionID into columns and need to fit starting from c1 to c5 based on each PersonID. If there are more than 5 values for a PersonID then i need to ignore the remaining values above first 5.

pastedImage_1.png

Can you please help in writing query to get tis result

This post has been answered by Frank Kulash on Jun 7 2018
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 5 2018
Added on Jun 7 2018
2 comments
88 views