Oracle set operations

Source: Internet
Author: User

Oracle set operation combines two or more result sets into one result set. Result set operations include:

  • INTERSECT (intersection) returns the records that are common to the two queries. Select deptno from dept intersect select deptno from emp;
  • Union all (UNION set) returns ALL records of each query, including duplicate records. Select deptno from dept union all select deptno from emp;
  • UNION (UNION) returns all records of each query, excluding duplicate records. Select deptno from dept UNION select deptno from emp;
  • MINUS returns the records retrieved from the first query MINUS the records retrieved from the second query. Select deptno from dept minus select deptno from emp;

When using the set operation, note: the number of columns returned by the query and the column type must be matched, and the column names can be different.

For more information about Oracle, see Oracle topics page http://www.bkjia.com/topicnews.aspx? Tid = 12

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.