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.

Level: intermediateTopic: SQL databases

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

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.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.