开发者

Left-Right Join operator in SQL Server 2008

开发者 https://www.devze.com 2023-01-25 21:14 出处:网络
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 c

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消