我有我的紅移的SQL Server數據,如:我要轉列到行
MatchId TeamId Teamname Home/away Teamstats statsvalue
1 101 a home yards 0
1 101 a home firstdown 1
1 101 a home points 2
1 101 a home completion 4
1 202 b away sacks 3
1 202 b away penalties 5
1 202 b away yards 6
1 202 b away points 7
我想要的數據是這樣的:
MatchId TeamId Teamname Home/away yards firstdown points completion sacks penalties
1 101 a home 0 1 2 4 3 5
1 202 b away 6 null 7 null null null
從一個快速的谷歌紅移是Postgresql而不是Microsoft SQL Server。那是對的嗎?如果是這樣,請刪除sql-server標籤。 –