Set operators combine the results of two queries into one. A query that contains a set operator is called a compound query.
The following table describes the set operators supported in the current version of OceanBase Database.
| Operator | Description |
|---|---|
| UNION | Returns all distinct rows selected by either query. |
| UNION ALL | Returns all rows selected by either query, including duplicates. |
| INTERSECT | Returns all distinct rows selected by both queries. |
| MINUS | Returns all distinct rows selected by the first query, excluding those that appear in the second query. |
For more information about set operators and examples, see Compound queries.
