Skip to content

Instantly share code, notes, and snippets.

@bartubozkurt
Created June 11, 2021 19:44
Show Gist options
  • Select an option

  • Save bartubozkurt/e6aa69e3e5b70ea1997c261fc79af18b to your computer and use it in GitHub Desktop.

Select an option

Save bartubozkurt/e6aa69e3e5b70ea1997c261fc79af18b to your computer and use it in GitHub Desktop.
It is used to combine all rows in the first selected table and matching rows in the second selected table. If the values in the first table do not match the values in the second table, it gets null.
SELECT city.name, country.name
FROM city
LEFT JOIN country
ON city.country_id = country.id;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment