我有以下数据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? –