Have tried to convert the columns to rows in oracle but the column headers should be the first column values.
Note: The select statement with WHERE clause. Have tried PIVOT and UNPIVOT but unfortunately I am not getting the desired output.
It should be converted to
Please assist.
Unpivot, as you said.
Sample data:
SQL> with test (column1, column2, column3) as
2 (select 385, 0, 29 from dual)
Query:
3 select *
4 from test
5 unpivot (value for type in (column1, column2, column3));
TYPE VALUE
------- ----------
COLUMN1 385
COLUMN2 0
COLUMN3 29
SQL>