【发布时间】:2019-03-11 09:53:28
【问题描述】:
我有两个表 table1 和 table2。我想从 table1 中选择,其中 id 不在 table2 id 中。
table1
id name
001 Testing
002 Hello
003 World
004 Programmer
table2
id name
001 Testing
003 World
我的期望
id name
002 Hello
004 Programmer
我试试这些代码
SELECT * FROM table1 as a where a.id <> (SELECT b.id from table2 as b )
有什么解决办法吗?
【问题讨论】:
标签: mysql