我有两张桌子:
游戏
`id` INT(11)
游戏标签
`game` INT(11)
`tag_id` INT(11)
game_tags.game =游戏.id
我对 MySQL 很不满意,所以这是我的问题:我希望能够找到games
具有一定数量的tag_id
's。因此,如果我有四个tag_id
(3、5、7、11),我希望能够通过查看game_tags
表格来找到哪些游戏将拥有所有这四个标签。这是我的意思的一个例子:
伪 MySQL:
SELECT *
FROM `games`
WHERE (search through game_tags table and find which rows have the same `game` field and all of the tag_id's that I need to search for)
LIMIT 0, 15
我知道我解释了这个可怕的东西(在我的脑海里无法形容),所以如果你有任何问题,请发表评论。