-4
我想從比賽(分數和回合)建立一個桌面聯盟。SQL Server桌面聯盟
我從我的SQL Server數據庫succceeded計算點,每個球隊和比賽,但我現在想生成表格聯賽..(足球)
有些人能幫助我嗎?
SELECT TOP (100) PERCENT dbo.jos_joomleague_matches.match_id, dbo.jos_joomleague_clubs.name AS Team, jos_joomleague_clubs_1.name AS Team2,
dbo.jos_joomleague_matches.match_date, dbo.jos_joomleague_matches.matchpart1_result, dbo.jos_joomleague_matches.matchpart2_result,
dbo.jos_joomleague_rounds.name,
CASE WHEN dbo.jos_joomleague_matches.matchpart1_result > dbo.jos_joomleague_matches.matchpart2_result THEN 3 WHEN dbo.jos_joomleague_matches.matchpart1_result
= dbo.jos_joomleague_matches.matchpart2_result THEN 1 ELSE 0 END AS ptsclub1HOME,
CASE WHEN dbo.jos_joomleague_matches.matchpart2_result > dbo.jos_joomleague_matches.matchpart1_result THEN 3 WHEN dbo.jos_joomleague_matches.matchpart2_result
= dbo.jos_joomleague_matches.matchpart1_result THEN 1 ELSE 0 END AS ptsclub2AWAY
FROM dbo.jos_joomleague_rounds INNER JOIN
dbo.jos_joomleague_clubs AS jos_joomleague_clubs_1 INNER JOIN
dbo.jos_joomleague_matches INNER JOIN
dbo.jos_joomleague_clubs ON dbo.jos_joomleague_matches.matchpart1 = dbo.jos_joomleague_clubs.id ON
jos_joomleague_clubs_1.id = dbo.jos_joomleague_matches.matchpart2 ON dbo.jos_joomleague_rounds.id = dbo.jos_joomleague_matches.round_id
ORDER BY dbo.jos_joomleague_matches.match_date
`
向我們展示(1)您當前的表結構和幾行示例數據(2)您期望的結果。 –
這是什麼問題?你描述你想要的東西,但不是你所做的任何事情,沒有表格結構,沒有起點。 – JNK