哪里不存在,请输入=“”

时间:2016-05-27 14:12:48

标签: mysql

我想检索一个名为=“game”的Steam应用列表以及表“match_connections”中不存在的位置

我尝试了什么

SELECT * FROM steam_apps t1 WHERE type="game" AND
  WHERE NOT EXISTS (SELECT 1 FROM match_connections t2 WHERE t1.appid = t2.steamid)
  ¨

数据库布局:

steam_apps

  • ID
  • 的appid
  • 名称

igdb_games

  • ID
  • gameid
  • 名称

match_connections

  • ID
  • igdbid(igdb_games的gameid)
  • steamid(steam_apps的appid)
  • igdb_name
  • steam_name

1 个答案:

答案 0 :(得分:0)

啊,我刚发现它:

SELECT * FROM steam_apps t1
  WHERE NOT EXISTS (SELECT 1 FROM match_connections t2 WHERE t1.appid = t2.steamid)
  AND type="game"