Skip to content
Advertisement

SQL query to convert no. of rows to no. of column in oracle

I need to convert all rows into columns i.e. no.of columns= total no. of values in col2 and col3 related to col1.

Scenario

enter image description here

Query tried:

How can I write a pivot query here?

Advertisement

Answer

use row_number() and conditional aggregation

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