从两个表中查找不匹配 id 的最快方法

编程入门 行业动态 更新时间:2024-10-26 13:21:56
本文介绍了从两个表中查找不匹配 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 的最快方法

本文发布于:2023-10-20 08:58:47,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1510517.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不匹配   最快   两个   方法   id

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!