【发布时间】:2017-05-17 18:16:36
【问题描述】:
有两张桌子
table1
ID
1
2
4
6
7
TABLE2
2
4
6
我想要 table1 中不在 table2 中的那些数字,我该怎么做? 我试试这个
select id from table1 t1
inner join table2 t2 on t1.id=t2.id
where t1.id not in (select id from table2)
但这不起作用
【问题讨论】:
-
你不必在这里写
join。 -
SQL NOT IN Clause的可能重复
-
那么?这个问题与重复问题不同
-
但这不起作用 -> 你得到了什么结果?或者可能是一个错误?请显示您的输出或错误消息。
-
我只有标题“ID”
标签: sql sql-server