首页 > 数据库技术 > 详细

oracle中not in 和 in 的替代写法

时间:2018-02-09 19:53:47      阅读:518      评论:0      收藏:0      [点我收藏+]

 

-- not in 的替代写法
select col from table1 where col not in
(select col from table2);

select col,table2.col temp_col
from table1 left join table2
on table1.col = table2.col
where temp_col is null;

-- in 的替代写法
select col from table1 where col in
(select col from table2);

select col,table2.col temp_col
from table1 left join table2
on table1.col = table2.col
where temp_col is not null;

 

oracle中not in 和 in 的替代写法

原文:https://www.cnblogs.com/qinjf/p/8436109.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!