Home > Database > Mysql Tutorial > Oracle 集合运算

Oracle 集合运算

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 17:13:10
Original
1072 people have browsed it

Oracle集合运算就是将两个或者多个结果集组合成为一个结果集。结果集运算包括:

Oracle集合运算就是将两个或者多个结果集组合成为一个结果集。结果集运算包括:

  • INTERSECT(交集),返回两个查询共有的记录。select deptno from dept intersect select deptno from emp;
  • UNION ALL(并集),返回各个查询的所有记录,包括重复记录。select deptno from dept UNION ALL select deptno from emp;
  • UNION(并集),返回各个查询的所有记录,不包括重复记录。select deptno from dept UNION  select deptno from emp;
  • MINUS(补集),返回第一个查询检索出的记录减去第二个查询检索的记录之后剩余的记录。select deptno from dept minus select deptno from emp;
  • 当使用集合操作的时候,要注意:查询所返回的列数以及列的类型必须比配,,列名可以不同。

    更多Oracle相关信息见Oracle 专题页面 ?tid=12

    linux

    Related labels:
    Statement of this Website
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
    Popular Tutorials
    More>
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template