0
我不知道我要如何做到這一點。 簡單的例子反向樞軸查詢幫助
studentid | sub1id | sub2id | and so on.....
----------------------------------------------------------
1 | 1 | 2 | and so on
3 | 5 | 6 | and so on
使用這樣的表結構......我要在以下形式的輸出特定學生
學生1
student | sub |
======================
1 | 1 |
1 | 2 |
學生2
student | sub |
======================
2 | 5 |
2 | 6 |
請你解釋一下這部分'unpivot(sub for subinid,sub2id)'謝謝 – mrN
@mrN - 看看這裏的解釋unpivot。 http://msdn.microsoft.com/en-us/library/ms177410.aspx –