Please help me to the SQL Oracle 9i, convert columns to rows in group by ID.
I can't convert using UNPIVOT in oracle 9i. And I will not use UNION ALL, it's too much code to use later.
From this list:
Table:
Employees
ID | DATA 1 | DATA 2 | DATA 3 | DATA 4 |
----------------------------------------------------------
1 | 0 | 1 | 3 | 2 |
2 | 1 | 0 | 3 | 0 |
Result
ID | SOURCE | DATA |
--------------------------------------
1 | DATA 2 | 1 |
1 | DATA 4 | 2 |
1 | DATA 3 | 3 |
2 | DATA 1 | 1 |
2 | DATA 3 | 3 |