Order Results By Occurrence
问题 I have the following two tables. BookmarkTag ( BookmarkID, TagID ) Tag ( TagID, Title) Currently I am selecting all the tags with the appropriate BookmarkID. The problem is I want to only select the tag once to avoid duplication in the result and also only bring back the tags the occur the most. This is my current SQL query: SELECT Tag.Title FROM `Tag` INNER JOIN BookmarkTag WHERE BookmarkTag.BookmarkID = 1 AND Tag.TagID = BookmarkTag.TagID' 回答1: You need to put the join condition in an ON