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 Column Values into Rows

BipulJun 7 2023 — edited Jun 7 2023

Hello Experts,

I am working on a specific input data structure, where a single column contains multiple unique values, as the following:

Id_Names are comma separated with an additional space (blank) between two values.

I would like to transform/transpose every comma separated values into individual record/row, as the following:

Is there a way to achieve like this?

Input data structure can be created using the following:

insert into test_data_bm1 (Id_Key, Id_Names) values('1a', '11-Red, 12-Green, 31-Yellow');
insert into test_data_bm1 (Id_Key, Id_Names) values('2b', '8-Purple, 91-Black, 63-Blue, 87-White');
insert into test_data_bm1 (Id_Key, Id_Names) values('3c', 'Morning, Midday, 109-Evening, 00-Night');
insert into test_data_bm1 (Id_Key, Id_Names) values('4s', 'Football, Tennis');

Highly appreciate your input and support !

Regards,

B Mandal

This post has been answered by BluShadow on Jun 7 2023
Jump to Answer
Comments
Post Details
Added on Jun 7 2023
1 comment
472 views