我有以下數據Pivot Unpivot問題?
Col1, Col2, Col3, Col4, Col5
1, P, W, M, adhfggh
1, P, W, M, fdasdfd
1, P, W, M, retretre
所以,我想獲得這個
Col1, Col2, Col3, Col4, ColA, ColB, ColC
1, P, W, M, adhfggh, fdasdfd, retretre
我應該嘗試這樣的事情,但不知道要放什麼東西在括號
select Col1, Col2, Col3, Col4, Col5 from tableA
Unpivot
(Col1, Col2, Col3, Col4 for Col5 in (, ,)) as UnPvt
我很感激任何幫助。
您正在使用哪些DBMS? –