except all
This functionality is not described by the SQL standard ISO/IEC 9075-2:2023. Prefer using the more widely supported except all
.
The table operator minus all
returns the rows of the first result except those that are also in the second.
SELECT …
FROM …
MINUS ALL
SELECT …
FROM …
As with all table operators both sides of minus
must have the same number of columns and their types must be compatible based on their position. All null
values are considered being the same (not distinct) for this operation.
Each occurrence of a row-value in the second result will remove of appearance of this row-value from the first result.
Same functionality in standard SQL: except all
Other table operators:
Union: union [distinct]
, union all
Intersect: intersect [distinct]
, intersect all
The table operation minus all
is not covered by any international standard.
You can’t catch up on 20 years of SQL evolution in one day. Subscribe the newsletter via E-Mail, Twitter or RSS to gradually catch up and to keep modern-sql.com on your radar.
The essence of SQL tuning in 200 pages
Buy now!
(paperback and/or PDF)
Paperback also available at Amazon.com.
Markus offers SQL training and consulting for developers working at companies of all sizes.
Learn more »