表 1 2 列:ID、名称
表 2 2 列:ID、名称
显示表 1 中不在表 2 中的名称的查询是什么?因此,过滤掉表 1 中表 2 中的所有名称即可得到结果查询。过滤是根据 ID 而不是名称。
最佳答案
Select * from table1
left join table2 on table1.id = table2.id
where table2.id is null
关于sql-server - 与内连接查询相反,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4044919/