Skip to content

Instantly share code, notes, and snippets.

@kironroy
Created December 17, 2019 02:08
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 kironroy/e30ff947a1cabf080134cfdb345c5fa3 to your computer and use it in GitHub Desktop.
Save kironroy/e30ff947a1cabf080134cfdb345c5fa3 to your computer and use it in GitHub Desktop.
SQL notes
-- inner join: only the records that match
-- left join: all the records from the left table, and all the matching records from the right table
-- right join: all the records from the right table, and all the matching records from the left table
select c.CompanyName, l.City
from dbo.Customers c
left join dbo.Locations l on c.id = l.CustomerId
select *
from dbo.customers
select *
from dbo.Locations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment