我正在使用访问权限,并且正在尝试编写一个查询,该查询将删除一列的重复项。到目前为止,这是我的查询:
SELECT
Drawings.DrawingID,
Players.NumOfGuessedAPainting,
Players.NumOfGuessedBPainting,
Players.NumOfGuessedCPainting,
Words.Word
FROM Words INNER JOIN
(Players INNER JOIN
(Drawings INNER JOIN
PlayersAndWords
ON Drawings.DrawingID = PlayersAndWords.DrawingID)
ON Players.PlayerID = PlayersAndWords.DrawingPlayerID)
ON Words.WordID = PlayersAndWords.WordID
WHERE ((Words.Word)='" + w + "')
ORDER BY (Players.NumOfGuessedAPainting
+Players.NumOfGuessedBPainting * 2
+Players.NumOfGuessedCPainting *3 ) DESC
该列Drawings.DrawingID
可能重复,我希望查询只返回每个 Drawings.DrawingID 的一行。“不同”在这里不起作用。我读过这group by
可能会有所帮助,但我不知道如何......
你能帮我吗?
提前致谢。