Skip to main content
SQL • LESSON 165

EXCEPT

How can we find customers who are not in the unsubscribed list?

Advanced3 Minutes1780 XP
🤔 THE QUESTION

How can we find customers who are not in the unsubscribed list?

💡 WHAT IS IT?

EXCEPT returns rows from the first query that do not exist in the second query.

🎯 WHAT IS IT USED FOR?

Suppression list filtering, churn audits, finding uncontacted customers.

💻 EXAMPLE
SELECT email
FROM customers
EXCEPT
SELECT email
FROM unsubscribed_customers;

🎯 Mission Objectives

Practice typing production-grade SQL code for EXCEPT.

  • EXCEPT operator
  • Set difference
  • Suppression filtering
  • Exclusion logic