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不支持
  • 相关阅读:
    中国一些web service收藏
    DataSet 和 List<T> 相互 转换
    JS图表
    IIS DirectoryEntry
    JS弹框
    Remoting
    Del SVN Configuare File BAT
    Viewport3D对象转换成图片
    在WPF中进行碰撞检测
    Button自定义样式
  • 原文地址:https://www.cnblogs.com/SoulReaper/p/3309800.html
Copyright © 2011-2022 走看看