Subquery v/s inner join in sql server

后端 未结 6 1500
伪装坚强ぢ
伪装坚强ぢ 2020-11-30 06:15

I have following queries

First one using inner join

SELECT item_ID,item_Code,item_Name 
FROM [Pharmacy].[tblitemHdr] I 
    INNER JOIN  EMR.tblFavour         


        
6条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-30 06:51

    Sub-query Vs Join

    Table one 20 rows,2 cols

    Table two 20 rows,2 cols

    sub-query 20*20

    join 20*2

    logical, rectify

    Detailed

    The scan count indicates multiplication effect as the system will have to go through again and again to fetch data, for your performance measure, just look at the time

提交回复
热议问题