What is the difference in these two queries as getting two different result set?

后端 未结 6 1050
礼貌的吻别
礼貌的吻别 2020-12-06 14:18

I am getting different result set for these two queries and second result set seems to be correct. What is the difference in these queries.

What type of inner join q

6条回答
  •  醉梦人生
    2020-12-06 15:02

    SQL is a declarative language, and it's up to the DBMS to implement your query. The SQL Server query optimiser does not care whether you inner-join two tables using a JOIN expression, a WHERE expression, an IN expression or an EXISTS expression, internally they are all treated the same. SQL Server has 3 different internal join algorithms, which are selected only on the basis of row count and data distribution, not the exact syntax used to declare them. If you compare the execution plans of the two queries in your example you should find that they are identical, and will therefore produce the same resultset.

提交回复
热议问题