Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save bartubozkurt/b82ca8657cb9acbfa5dc43760a261137 to your computer and use it in GitHub Desktop.
It is used to merge all rows from the second selected table and the matching rows from the first selected table. Returns null if there is a value in the second table that does not match the first table
SELECT city.name, country.name
FROM city
RIGHT JOIN country
ON city.country_id = city.id;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment