Set Operator Rules

Set operators are used to combine the records from multiple SELECT statements. The set operator is placed between the two SELECT statements. The operator tells Oracle how the records that each of the SELECT statements retrieves must be merged, compared, or discarded until one virtual table is created. The entire virtual record from each record set is evaluated against each other; therefore, the following rules apply:

  1. Each of the SELECT clauses must have the same number of expressions.

  2. Each expression in the SELECT clause must have the same data type as the corresponding expression in the other SELECT clauses.

  3. Each SELECT statement is part of one overall statement. The minor SELECT statements may have all of the SELECT clauses ...

Get Oracle SQL and PL/SQL Handbook: A Guide for Data Administrators, Developers, and Business Analysts 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.