Left-Right Join operator in SQL Server 2008
I am migrating my oracle db to SQL Server 2008.In oracle we can use =(+) operator to indicate left or right joins. In SQL Server is there a operator to indicate left or right joins? Should we always code as L开发者_StackOverflowEFT JOIN ... ON ...?
You should always use LEFT OUTER JOIN
and RIGHT OUTER JOIN
in my opinion.
- it's clearer from the statement what you're doing
- it's the ANSI standard for JOINs in any SQL-based relational db system
- it works on various systems, other than any proprietary extensions like the += and =+ in Oracle
There isn't a specific operator like that - you should use the explicit LEFT JOIN
or RIGHT JOIN
notation.
The old *=
syntax was removed from SQL Server in 2005. To use it set the compatibility level to 80.
精彩评论