Created
May 25, 2016 18:26
-
-
Save dan81989/41de34784f09c5296df3765f981c805a to your computer and use it in GitHub Desktop.
Why would such a left join be useful? Simply adding a “where order_date is NULL” line to our SQL query will return a list of all customers who have not placed an order:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select first_name, last_name, order_date, order_amount | |
from customers c | |
left join orders o | |
on c.customer_id = o.customer_id | |
where order_date is NULL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment