Will ANSI JOIN vs. non-ANSI JOIN queries perform differently?

前端 未结 7 1760
我在风中等你
我在风中等你 2020-11-22 02:25

I have my business-logic in ~7000 lines of T-SQL stored procedures, and most of them has next JOIN syntax:

SELECT A.A, B.B, C.C
FROM aaa AS A, bbb AS B, ccc          


        
7条回答
  •  爱一瞬间的悲伤
    2020-11-22 03:04

    The two queries are equal - the first is using non-ANSI JOIN syntax, the 2nd is ANSI JOIN syntax. I recommend sticking with the ANSI JOIN syntax.

    And yes, LEFT OUTER JOINs (which, btw are also ANSI JOIN syntax) are what you want to use when there's a possibility that the table you're joining to might not contain any matching records.

    Reference: Conditional Joins in SQL Server

提交回复
热议问题