0
我有表客戶如何在sql server 2008中寫入行到列的查詢?
customerno sname contactid address
1 aaa 101 north
1 bbb 102 south
1 ccc 103 west
2 ddd 104 south
2 ccc 105 north
2 eee 106 null
我想特別客戶詳細信息轉換成單行。 我想導致像
Customerno sname1 sname2 sname3 address1 address2 address3
1 aaa bbb ccc north south west
2 ddd ccc eee south north null
幫我........
我要補充的是,上述解決方案僅適用,你有一個已知的結合或條目的限制您希望爲表中的每個customerno旋轉,因爲這將取決於您創建的自加入的數量 – 2010-11-25 20:20:29