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

  • 相关阅读:
    (转) hive调优(2)
    (转)hive调优(1) coding调优
    hive on tez 错误记录
    tez 0.9.0 配置
    hive on tez
    让博客园自动生成目录
    hive --metastore三种模式
    hive 使用beelin连接报错
    mysql my.cnf文件
    1、Kfaka 部署
  • 原文地址:https://www.cnblogs.com/Jims2016/p/5909384.html
Copyright © 2011-2022 走看看