-
Notifications
You must be signed in to change notification settings - Fork 405
Set operations
Daniël van Eeden edited this page Mar 13, 2024
·
6 revisions
SQL standard defines the following set operations:
UNION [ALL | DISTINCT]
| EXCEPT [ALL | DISTINCT]
| INTERSECT [ALL | DISTINCT]
All dialects support UNION
, with rest there are variations:
UNION {ALL | DISTINCT}
| EXCEPT DISTINCT
| INTERSECT DISTINCT
DB2:
UNION [ALL]
| EXCEPT [ALL]
| INTERSECT [ALL]
Hive:
UNION [ALL | DISTINCT]
UNION [ALL | DISTINCT]
| EXCEPT [ALL | DISTINCT]
| INTERSECT [ALL | DISTINCT]
| MINUS [ALL | DISTINCT]
UNION [ALL | DISTINCT]
N1QL:
UNION [ALL]
| EXCEPT [ALL]
| INTERSECT [ALL]
UNION [ALL]
| EXCEPT
| INTERSECT
UNION [ALL | DISTINCT]
| EXCEPT [ALL | DISTINCT]
| INTERSECT [ALL | DISTINCT]
UNION [ ALL ]
| EXCEPT
| INTERSECT
| MINUS
SingleStoreDB (union, intersect, except and minus):
UNION [ALL | DISTINCT]
| EXCEPT
| INTERSECT
| MINUS
UNION [ALL]
| EXCEPT
| MINUS
| INTERSECT
UNION [ALL | DISTINCT]
| EXCEPT [ALL | DISTINCT]
| INTERSECT [ALL | DISTINCT]
UNION [ALL]
| EXCEPT
| INTERSECT
TiDB:
UNION [ALL | DISTINCT]
UNION [ALL]
| EXCEPT
| INTERSECT
UNION [ALL | DISTINCT]
| EXCEPT [ALL | DISTINCT]
| INTERSECT [ALL | DISTINCT]