Chapter 9. Set Operators

Set operators combine two or more sets of data to produce a single result set. Oracle has four set operators: UNION, UNION ALL, MINUS, and INTERSECT. The UNION and UNION ALL operators combine results. The INTERSECT operator determines common rows. The MINUS operator shows differences between sets of rows.

The sets of data in a set operation are SELECT statements and when writing any set operation, there are two rules to remember.

• Each of the SELECT lists must contain the same number of columns.

• The matching columns in each of the SELECT lists must be the same data type. (Oracle considers ...

Get Oracle SQL By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.