zoukankan      html  css  js  c++  java
  • Oracle集合操作

    Oracle集合运算

    • 并集  

           

                         

      在集合A和集合B中,如图代表A和B都包含。在我们的sql语句中,有两个关键字来表示这种关系,分别是:

      Union和Union All

    • union all   并集  重复

    --union all 并集  重复
    select * from student where gender='' 
    union all 
    select * from student where sal>3000;

       union  并集 不重复

    --union  并集  不重复
    select * from student where gender='' 
    union 
    select * from student where sal<3000;
    • 交集    

                           

      inertsect  交集

    --intersect  交集(取相同部分)
    select * from student where gender='' 
    intersect
    select * from student where sal<3000
    intersect 
    select * from student where name like 'J%';
    • 减集(余集)

                         

    --minus  减集
    select * from student  
    minus
    select * from student where sal<10000;

    在sql server 中用except

  • 相关阅读:
    网络问题排查
    SpringBoot 自定义注解清除缓存
    MYSQL外键的使用以及优缺点
    Java List
    黑客帝国代码雨
    前端接收字节数据流,显示图片
    何为熔断降级
    spring的线程
    window.open 与 iframe
    js 全部替换
  • 原文地址:https://www.cnblogs.com/Jims2016/p/5909384.html
Copyright © 2011-2022 走看看