ORACLE中exists与in的区别

ORACLE中exists与in的区别
强烈推介IDEA2020.2破解激活,IntelliJ IDEA 注册码,2020.2 IDEA 激活码
--exists支持字段为空
select * from t_flight_info a where not exists (select * from M_CITY_PAIR where a.adeps=M_CITY_PAIR.APT1 and a.adess=M_CITY_PAIR.APT2);

select * from M_CITY_PAIR where apt1='VTBS' and apt2='ZBDT';


--not in 子查询的结果字段不能为NULL,apt1||apt2不能都为空
select * from t_flight_info a where a.adeps||a.adess not in (select  apt1||apt2 from M_CITY_PAIR);
select * from M_CITY_PAIR where apt1='VTBS' and apt2='ZBDT';

 

本文来源huayang183,由架构君转载发布,观点不代表Java架构师必看的立场,转载请标明来源出处:https://javajgs.com/archives/18614

发表评论