zoukankan      html  css  js  c++  java
  • 数据库之集合查询

    集合查询

    一、并查询(union)

        格式:
    select ...........
    from 表1 left join 表2
    on........
    union
    select ...........
    from 表2 right join 表2
    on........
        作用:
    求两个select的并集,去掉重复项
        注意:
    两个表的字段数和数据类型相同
    二、交查询(intersect)
        格式
    (select ...........
    from .......
    where........)
    intersect
    (select ...........
    from........
    where........)
        作用:
    求两个select的交集
        注意:
    两个表的字段数和数据类型相同,mysql不支持
    三、差查询(minus/except) 
    格式1(oracle):
    select ...........
    from .......
    where........
    minus
    select ...........
    from........
    where........
    格式2(sql server):
    select ...........
    from .......
    where........
    except
    select ...........
    from........
    where........
        作用:
    找出满足第一个select并不满足第二个select的数据
        注意:
    两个表的字段数和数据类型相同,mysql不支持
  • 相关阅读:
    HTML学习心得
    VS相关
    安全算法
    第三方库的编译
    C++编译问题
    GCC编译
    linux系统·用户管理
    批处理遍历并计算子文件夹下的文件数目
    [Tianchi] Repeat Buyers Prediction-Challenge the Baseline -- version 0
    win10安装cuda
  • 原文地址:https://www.cnblogs.com/SoulReaper/p/3309800.html
Copyright © 2011-2022 走看看