Given the SQL statement:
SELECT * FROM MY_TABLE WHERE SomeNumberField in (0,99999)
If I can guarantee that most of the rows in MY_TABLE have SomeNumberField equal to 99999 and can project that this will remain undefined in this case, is it better to write the above query as follows:
SELECT * FROM MY_TABLE WHERE SomeNumberField in (99999,0)
performance sql sql-server tsql sql-server-2005
James wiseman
source share