Skip to content
Advertisement

Oracle SQL Transforming sql rows into columns grouping by another column

I am facing trouble designing SQL for the below scenario.

My table structure looks like this

TABLE IMSK

As you can see, I store 3 keys for every group id. Values will be different for each group_id. I need to show this information in a report in the following manner.

Keys will become the column headers and every row will correspond to a group_id

Advertisement

Answer

One method is conditional aggregation:

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement