sql server 'in' or 'or' - which is fastest

前端 未结 3 1489
自闭症患者
自闭症患者 2021-01-05 01:20

Ok, so I have a query:

select distinct(a)
from mytable
where
b in (0,3)

What is going to be faster, the above or

select di         


        
3条回答
  •  北荒
    北荒 (楼主)
    2021-01-05 01:33

    As far as I know, IN converts to OR. So the performance is the same. Just a shorter way of writing it.

提交回复
热议问题