Created
May 25, 2016 18:23
-
-
Save dan81989/cf6bde6540bb49780d75ba20f837e13d to your computer and use it in GitHub Desktop.
If we wanted to simply append information about orders to our customers table, regardless of whether a customer placed an order or not, we would use a left join. A left join returns all records from table A and any matching records in table B.
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment