首页 > 数据库技术 > 详细

Oracle in 查询数据

时间:2017-09-20 15:34:11      阅读:336      评论:0      收藏:0      [点我收藏+]

问题描述:

  查询所有的数据,查询结果:146360

select count(1) from bank_cde; 

  in查询的获取部分数据,查询结果 :73080

select count(1) from bank_cde t where t.belongcode2  in(ABC,BCOM,BOC,CCB,CEB,CGB,CIB,CITIC,CMBC,ICBC,PAB,POST,SPDB);

  not in查询数据,结果为0

select count(1) from bank_cde t where t.belongcode2 not in(ABC,BCOM,BOC,CCB,CEB,CGB,CIB,CITIC,CMBC,ICBC,PAB,POST,SPDB);

原因:

  本以为in 和not in 为查询两种结果互补,还有一种情况 为 null

select count(1) from bank_cde t where t.belongcode2 is null;

 

Oracle in 查询数据

原文:http://www.cnblogs.com/choiyubo163com/p/7561583.html

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