我正在使用訪問,並試圖編寫一個查詢,它將刪除一列的重複項。這裏是我的查詢到目前爲止:刪除有一列重複的行(不是'不同')
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
可能會幫助,但我無法形容如何..
你能幫助我嗎?
在此先感謝。
爲什麼不明顯的工作? – 2013-03-25 10:37:31