0
我在我的数据库中有3个表,tbl_user,tbl_games和tbl_usergames。MySQL搜索文本和链接表
tbl_user有id和名称。
tbl_games有ID和名称。
tbl_usergames有id_user和id_game并链接到tbl_user tbl_games
我想要返回谁拥有的任何游戏,名字与之相匹配的搜索字符串用户的搜索。
SELECT tbl_user.*
FROM tbl_user, tbl_usergames
WHERE tbl_user.id IN (
**SELECT id
FROM tbl_games
WHERE name LIKE '%Mario%'**
)
我试过这个,但是它返回0个结果。
http://www.w3schools.com/sql/default.asp – Sebas 2013-03-18 18:19:53
@Sebas w3fools.com – Kermit 2013-03-18 18:21:19
是的,也许。我认为你有点生气。我的这个评论的目的是指出OP正确学习SQL的必要性,并提到一个友好教程的例子。 – Sebas 2013-03-18 18:24:36