AI engineering glossary · SQL databases
What is MINUS (EXCEPT)?
EXCEPT (also called MINUS): A set operator that returns rows from the first query's result that do not appear in the second, removing duplicates. Oracle calls it MINUS. Order matters. It is the set-difference of two result sets.
EXCEPT: an example
SELECT id FROM all_users EXCEPT SELECT id FROM paying_users; lists users who never paid.
Related terms
More SQL databases terms
- Execution plan
- EXISTS
- EXPLAIN
- First normal form
- Foreign key
- FULL OUTER JOIN
- Full table scan
- Functional dependency
Where you learn it
EXCEPT is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.