我在SqlFiddle(http://sqlfiddle.com/#!3/72398/3)
中创建了表和数据我有3个数据表
dbo.Contracts
:
C_ID,
C_NAME,
C_VOLUME
dbo.Players
:
P_ID,
P_NAME
dbo.ContractPlayers
:
C_ID,
P_ID,
Share
我能够进行垂直显示数据的简单连接。但我需要水平数据
像这样:
C_ID | C_NAME | C_Volume | P_NAME1 | SHARE1 | P_NAME2 | SHARE2 | P_NAME3 | SHARE3 |
1 | Agriculture | 40000 | Johndeer | 3000 | Statefarm | 4500 | Vortex | 3200 |
2 | Chemicals | 50000 | Johndeer | 1231 | Statefarm | 2345 | Vortex | 2311 |
3 | Autos | 35000 | Johndeer | 1212 | Statefarm | 1111 | Vortex | 4534 |
我假设这是可能的。请帮助这里是sqlFiddle(http://sqlfiddle.com/#!3/72398/3)