从两个表中查找不匹配 id 的最快方法 [英] fastest way to find non-matching ids from two tables

查看:24
本文介绍了从两个表中查找不匹配 id 的最快方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有 1000 个值的基表.和第二个具有 100 个值的临时表.我需要通过 guid 比较它们并只返回第二个表中第一个表中不存在的那些行.为此,我需要最快的性能解决方案.谢谢!

I have base table with 1000 values. and second temporary table with 100 values. I need to compare them by guids and return only those rows from second table that do not exist in first table. I need the fastest performance solution for that. Thanks!

推荐答案

经典的 left join/isnull 测试

The classic left join/isnull test

select A.*
from secondTbl A
left join firstTbl B on A.guid = B.guid
WHERE B.guid is null

这篇关于从两个表中查找不匹配 id 的最快方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆