Skip to content

Instantly share code, notes, and snippets.

@dan81989
Created May 24, 2016 20:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dan81989/aaeef78733287143f43446a29a1f62b1 to your computer and use it in GitHub Desktop.
Save dan81989/aaeef78733287143f43446a29a1f62b1 to your computer and use it in GitHub Desktop.
Let’s say we wanted to get a list of those customers who placed an order and the details of the order they placed. This would be a perfect fit for an inner join, since an inner join returns records at the intersection of the two tables.
select first_name, last_name, order_date, order_amount
from customers c
inner 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