社区
基础和管理
帖子详情
关于 not in
yaotiebing
2003-08-26 09:49:59
select usercode from table1 where usercode not in (select Usercode from table2) 这样的sQL 语句执行起来的效率非常低 有没有好的实现方法
...全文
38
9
打赏
收藏
关于 not in
select usercode from table1 where usercode not in (select Usercode from table2) 这样的sQL 语句执行起来的效率非常低 有没有好的实现方法
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
9 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
hdkkk
2003-08-26
打赏
举报
回复
select usercode from t1 where not exists (select 'X' from t2 where t1.usercode=t2.usercode)
hdkkk
2003-08-26
打赏
举报
回复
select usercode from table1 minus (select Usercode from table2)
hh23_
2003-08-26
打赏
举报
回复
select t1.usercode from table1 t1,table2 t2 where t1.usercode<>t2.usercode
hdkkk
2003-08-26
打赏
举报
回复
我的错了,请勿略
jiezhi
2003-08-26
打赏
举报
回复
select a.usercode from table1 a,table2 b where
a.usercode<>b.usercode
armu80830
2003-08-26
打赏
举报
回复
select usercode from table1
minus
select Usercode from table2
hdkkk
2003-08-26
打赏
举报
回复
select usercode from table1 where usercode not exists (select Usercode from table2)
select t1.usercode from table1 t1,table2 t2 where t1.usercode<>t2.usercode
enhydraboy
2003-08-26
打赏
举报
回复
select table1.usercode from table1,table2 where
table1.usercode = table2.usercode(+) and table2.username is null
yaotiebing
2003-08-26
打赏
举报
回复
minus 比 not in 的效率高吗??
Oracle 关于 not in 的坑 ,not in 查询不出数据
select * from A a where a.id not in (select b.id from B b ) 如上查询 如果 当 B表 的 id中有 null 时 此时数据查询不到 应该为 select * from A a where a.id not in (select b.id ...
python in 与 not in 用法及运算符
一、in 与 not in python 中,in 与 not in 是用来作为逻辑判断的另一种方式。(与linux 的grep 命令有一定类似) 文字解释可以理解成这样。 in 右侧的内容里,是否包含了左侧的内容。 包含返回真,不包含返回假。 not in 右侧的内容里是否不包含左侧的内容。不包含返回真,包含返回假。 in 与 not in 可以放在任何允许添加条件判断的位置。如while 、 if 等。 格式 if str1 in str2: do xxx else d...
浅谈sql中的in与not in,exists与not exists的区别以及性能分析
浅谈sql中的in与not in,exists与not exists的区别
SQL中in和not in
SQL中in的用法 IN和NOT IN IN 和NOT IN 都属于确定集合的一种; IN用来查找属性值属于指定集合的元组; NOT IN 用来查找属性值不属于指定集合的元组。 IN 例:查询计算机科学系(CS)、数学系(MA)、信息系(IS)学生的姓名和性别。 select Sname,Ssex from Student Where Sdept in('CS','MA','IS'); 有的题中的IN可以用多个OR来代替,比如这道题也可以写成这种形式: select Sname,Ssex From St
详解not in与not exists的区别与用法(not in的性能并不差)
在网上搜了下关于oracle中not exists和not in性能的比较,发现没有描述的太全面的,可能是问题太简单了,达人们都不屑于解释吧。于是自己花了点时间,试图把这个问题简单描述清楚,其实归根结底一句话:not in性能并不比not exists差,关键看你用的是否正确。 我先建两个示范表,便于说明: crea...
基础和管理
17,377
社区成员
95,128
社区内容
发帖
与我相关
我的任务
基础和管理
Oracle 基础和管理
复制链接
扫一扫
分享
社区描述
Oracle 基础和管理
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章