请教left outer join和no in的不同

离子漂浮物 离子漂浮物 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
not In
select * from table where id not in (select top 100 id from table order by id desc)

left outer join

select * from table left outer join (select top 100 id as tId from table order by id desc) t on t.tId = table.id where t.tId is null


两句的效果是一样的,效率上来说哪个比较好..手上没有大数据库进行测试,有没人帮忙看看
...全文

相关推荐

评论 8
收藏 已收藏
分享
返回顶部
离子漂浮物
MS-SQL Server 34,877 成员 254,635 内容