表包含以下列和數據:如何通過變換並重復下一行將行轉換爲列?
Id | Date 1 | 04/09/2014 13:00:00 1 | 04/10/2014 15:00:00 1 | 04/12/2014 16:00:00 1 | 04/13/2014 18:00:00 2 | 04/11/2014 13:00:00 2 | 04/12/2014 15:00:00 2 | 04/12/2014 16:00:00
我需要得到每個垂直對每個ID並將其轉換爲水平視圖,其結果應該是這樣的:
| ID | DATE1 | DATE2 | | 1 | April, 09 2014 13:00:00 | April, 10 2014 15:00:00 | | 1 | April, 10 2014 15:00:00 | April, 12 2014 16:00:00 | | 1 | April, 12 2014 16:00:00 | April, 13 2014 18:00:00 | | 1 | April, 13 2014 18:00:00 | (null) | | 2 | April, 11 2014 13:00:00 | April, 12 2014 15:00:00 | | 2 | April, 12 2014 15:00:00 | April, 12 2014 16:00:00 | | 2 | April, 12 2014 16:00:00 | (null) |
我有SQL服務器的解決方案,並試圖將其轉換爲Oracle,但不能 – user3580877