On a date field I have a default value that indicates a non-completion of a task. When I query to find all completed tasks which is better if my default date is 12/31/9999?
SELECT * FROM Table WHERE Completed <> '12/31/9999'
OR
SELECT * FROM Table WHERE Completed < '12/31/9999'
Or does it completely depend on my indexing.
Here are the key operators used in the WHERE clause, ordered by their performance. Those operators at the top will produce results faster than those listed at the bottom.
=
>, >=, <, <=
LIKE
<>
http://www.sql-server-performance.com/2007/t-sql-where/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With