Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save bartubozkurt/35f6732ff84e6b65ee8d80077c9a7347 to your computer and use it in GitHub Desktop.
(or explicitly FULL OUTER JOIN) returns all rows from both tables - if there's no matching row in the second table, NULLs are returned.
SELECT city.name, country.name
FROM city
FULL 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