Skip to content

Instantly share code, notes, and snippets.

@marcoandre1
Last active October 15, 2019 14:52
Show Gist options
  • Save marcoandre1/1a9a772610801b07892d28b81ee3e342 to your computer and use it in GitHub Desktop.
Save marcoandre1/1a9a772610801b07892d28b81ee3e342 to your computer and use it in GitHub Desktop.
JOIN statement in SQL Server

From StackOverflow

<join_type> ::= 
    [ { INNER | { { LEFT | RIGHT | FULL } [ OUTER ] } } [ <join_hint> ] ]
    JOIN
  • If you just mention JOIN then by default it is a INNER JOIN.
  • An OUTER join has to be LEFT | RIGHT | FULL you can not simply say OUTER JOIN.
  • You can drop OUTER keyword and just say LEFT JOIN or RIGHT JOIN or FULL JOIN.

SQL Join

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment