-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