Is there a difference using join andselect from multi-tables?

前端 未结 5 1436
借酒劲吻你
借酒劲吻你 2020-12-07 04:22

First option:

SELECT Table1.* ,Table2.Price AS Price
FROM
  Table1,Table2
WHERE
  Table1.ID = Table2.ID 

Second op

5条回答
  •  执念已碎
    2020-12-07 05:14

    the first query join style uses ancient join syntax, while the second style is more current. In most cases they result in the exact same query execution plan. However when using LEFT AND RIGHT OUTER JOINS, you can have probelms, see this answer and the comments:

    ANSI joins versus "where clause" joins

    from SQL Server BOL(2000) "In earlier versions of Microsoft® SQL Server™ 2000 left and right outer join conditions were specified in the WHERE clause using the *= and =* operators. In some cases, this syntax results in an ambiguous query that can be interpreted in more than one way.

提交回复
热议问题