SQL服务器比较2个表以查找不存在的记录 [英] Ms SQL server compare 2 tables for records not existing
本文介绍了SQL服务器比较2个表以查找不存在的记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请查看并给出最合适的选择声明进行比较
2表格中没有现有记录
ms sql server比较2表对于不存在的记录
请提供最快的选择声明。
谢谢
我尝试过的事情:
Please review and give the most appropriate select statement to compare
2 tables for records not existing
ms sql server compare 2 tables for records not existing
Please provide the fastest select statement .
Thanks
What I have tried:
SELECT a.name
FROM a
WHERE a.joint_id NOT IN ( SELECT b.joint_id
FROM b
)
推荐答案
这是效率最高的。请参阅此处:不在vs. NOT EXISTS vs. LEFT JOIN / IS NULL [ ^ ]
That's the most efficient. See here: NOT IN vs. NOT EXISTS vs. LEFT JOIN / IS NULL[^]
这篇关于SQL服务器比较2个表以查找不存在的记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文