我尝试在Access 2013中运行以下查询,但没有结果。
SELECT PlayerID, RoundID, Rank
FROM P_7to8Ranking AS s
WHERE Rank IN
(
SELECT Rank
FROM P_7to8Ranking
WHERE PlayerID = s.PlayerID and (s.Rank=1 or s.Rank=2)
)
ORDER BY PlayerID, Rank , RoundID DESC;
但是当它在SQL Fiddle中运行时,它运行正常。这是链接http://sqlfiddle.com/#!3/5260e/3。
它让我爬上了墙。请帮忙
答案 0 :(得分:0)
你的查询看起来很奇怪...也许我错过了一些东西但是,这是否会产生相同的效果并且更容易且性能更好?
SELECT PlayerID, RoundID, Rank
FROM P_7to8Ranking AS
WHERE Rank IN (1,2)
ORDER BY PlayerID, Rank , RoundID DESC;
您是否尝试将表别名放在列选择中?