| ROW_VALUE |
|---|
| Bob,CSE 510,CSE 594,CSE 310 |
| Angela,CSE 580,CSE 594,CSE 320,CSE 510,CSE 310 |
with unpivoted_data as (
select *
from imported_data,
table(split_to_table(row_value, ',')) as t1
)
select *
from unpivoted_data
pivot (min(value) for index in (ANY));
| SEQ | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|
| 2 | Angela | CSE 580 | CSE 594 | CSE 320 | CSE 510 | CSE 310 |
| 1 | Bob | CSE 510 | CSE 594 | CSE 310 |