For a list of constants, MySQL will internally extend your code to:
SELECT * FROM tbl WHERE ((col <> 9 and col <> 10))
Same thing for another, instead of 8 times = .
So yes, the first will be faster, fewer comparisons. The chances of it being measurable are negligible, but the overhead of a few ongoing comparisons is no different from the general overhead of parsing SQL and getting data.
Niels keurentjes
source share