Oracle Style Joins in SQL Server

后端 未结 2 2009
野的像风
野的像风 2020-12-21 11:27

Is there a way to do oracle style joins in SQL Server?

select * 
from t1, t2
where t1.id = t2.id (+)

EDIT

Why is it preferabl

相关标签:
2条回答
  • 2020-12-21 11:32
    SELECT *
    FROM t1
    LEFT OUTER JOIN t2 ON t1.id = t2.id
    

    This AskTom article shows you the syntax equivalencies from (+) to (LEFT AND RIGHT) OUTER JOIN for Oracle, and SQL Server uses the OUTER JOIN syntax.

    0 讨论(0)
  • 2020-12-21 11:41

    Microsoft is using the ANSI ISO SQL Standard. Mark Rittman has a good explanation of ANSI joins and why you should use them. SQL Server, however, doesn't support the NATURAL JOIN syntax that's listed in that article and the ANSI standard. You may be more familiar with the old Oracle syntax, but it is the standard and something that you'll find on other database products.

    To answer your question - there is no way to perform Oracle style joins on SQL Server. Even the *= and =* style joins have been deprecated and are being removed completely in the next version of the product.

    0 讨论(0)
提交回复
热议问题