I have a question in regarding to Oracle Sql,
If I have a data called A, with 8 columns:
Spot| ID |Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday
-------------------------------------------------------------------------
A| 1 | 0.1 |0.15 | ...........................................
-------------------------------------------------------------------------
A| 2 | 0.2 |0.2 | ...........................................
-------------------------------------------------------------------------
A| 3 | 0.3 |0.25 | ...........................................
-------------------------------------------------------------------------
A| 4 | 0.4 |0.4 | ...........................................
-------------------------------------------------------------------------
Can I convert it to a table B like this:
Spot| Day of Week | ID | Value
-------------------------------------------------------------------------
A| 1 | 1 | 0.1
-------------------------------------------------------------------------
A| 1 | 2 | 0.2
-------------------------------------------------------------------------
A| 1 | 3 | 0.3
-------------------------------------------------------------------------
A| 1 | 4 | 0.4
-------------------------------------------------------------------------
A| 2 | 1 | 0.15
-------------------------------------------------------------------------
.......................................................................
Which is to combine columns (Sunday through Saturday) to a new column called 'Day of Week'
How can I do that please? Thanks!
See Question&Answers more detail:os