Performance of SQL “EXISTS” usage variants

后端 未结 9 742
-上瘾入骨i
-上瘾入骨i 2020-12-05 04:39

Is there any difference in the performance of the following three SQL statements?

SELECT * FROM tableA WHERE EXISTS (SELECT * FROM tableB WHERE tableA.x = ta         


        
9条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-05 05:21

    The EXISTS returns a boolean not actual data, that said best practice is to use #3.

提交回复
热议问题