Set operators combine the results of two queries into a single result. Queries that contain set operators are called compound queries.
The following table lists the set operators that are supported by the current version of OceanBase Database.
| Operator | Return value |
|---|---|
| UNION | Returns all distinct rows selected by either query. |
| UNION ALL | Returns all rows selected by either query, including all duplicate rows. |
| INTERSECT | Returns all distinct rows selected by both queries. |
| MINUS | Returns distinct rows selected by the first query but not the second. |
For more information and examples about set operators, see Compound queries.