I have the data as follows:-
Item_ID Activity
1 "In-Store"
1 "Online"
1 "Mall"
1 "Shops"
2 "Flagship"
2 "Destination"
And I want to convert the rows into columns as follows:-
Item_ID Column_1 Column_2 Column_3 Column_4
1 "In-Store" "Online" "Mall" "Shops"
2 "Flagship" "Destination"
Please can someone guide me how to do the above in Oracle SQL? I have tried the PIVOT function but it requires static (hardcoded) list of values.
An Item can have upto 4 activities but the value in activity can be anything (I have 135 unique values in the Activity column and the activity list is dynamic).