-1

I would like to know from below queries, which one would give better performance and how?

select * from TableA where (Name = 'ABC' or Name = 'DEF' or Name = 'GHI')

or

select * from TableA where Name in ('ABC','DEF','GHI')
Tech Learner
  • 1,227
  • 6
  • 24
  • 59
  • 2
    Already answered here https://stackoverflow.com/questions/3074713/in-vs-or-in-the-sql-where-clause – PSK Jan 29 '18 at 07:12

1 Answers1

1

Internally both IN and OR operators perform the same action. More importantly you need to see if you have proper index on the Name column.You can have a non-clustered index on the Name column and have one clustered index on this table.

AnandPhadke
  • 13,160
  • 5
  • 26
  • 33