Oracle's set operation function---minus, union, intersect

Source: Internet
Author: User

The set operator is specifically used to merge the results of multiple SELECT statements, including: Union,union All,intersect,minus. When using the set operation function, ensure that the data type and number of fields in the dataset are the same.

The use of the set operator requires attention:

  • The set operator does not apply to log, Varray, and nested lists.
  • The Union, Interesect, and minus operations do not work on long columns.
  • If the selection column contains an expression or function, you must define a column alias for the expression or function.

1. UNION

When you use union, the columns that are repeated in the dataset are automatically filtered and sorted in ascending order from the results of the first column.

2. UNION All

The result set contains all the data, does not filter duplicate rows, and does not sort the results.

3, Intersect

The intersection of two result sets is taken, and the results of the first column are sorted in ascending order.

4, minus

Displays only the data that exists in the first collection that does not exist in the second collection, and is sorted in ascending order with the results of the first column.

Oracle's set operation function---minus, union, intersect

Related Article

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.