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

  • 相关阅读:
    vue中 根据音频 获取音频的时长
    获取dom位置信息
    react笔记
    Git 基础命令
    vue 笔记
    倒计时
    删留言
    python 类之类变量与实例变量
    python 类的定义
    python 列表推导式
  • 原文地址:https://www.cnblogs.com/Jims2016/p/5909384.html
Copyright © 2011-2022 走看看