首页 > 数据库技术 > 详细

Oracle联合查询

时间:2016-09-20 21:19:23      阅读:260      评论:0      收藏:0      [点我收藏+]

select * from teacher
--联合查询
--01.union (并集)
select tno from teacher where tno>1080 union
(select tno from teacher where tno>1090)
--02.union all(并集并且显示重复的数据)
select tno from teacher where tno>1080 union all
(select tno from teacher where tno>1090)
--03.minus(补集) a minus b a-b相当于去掉重复的数据 确保a的返回大于b的范围
select tno from teacher where tno>1080 minus
(select tno from teacher where tno>1090)
--04.intersect(交集) 只查询重复的数据
select tno from teacher where tno>1080 intersect
(select tno from teacher where tno>1090)

 

Oracle联合查询

原文:http://www.cnblogs.com/liu-chao-feng/p/5890339.html

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