SQL Server Performance Forum – Threads Archive
BETWEEN vs > AND <Does anyone know which performs better- ‘BETWEEN’ or ‘> AND <‘ eg Select *
WHERE date BETWEEN 01/01/2004 AND 10/01/2004 OR SELECT *
WHERE date > 01/01/2004 AND < 10/01/2004 ??? Thanks in advance
(1) BETWEEN … AND … includes the dates that you put up, so you need to use the equal sign as well: >= … AND <= … (2) Use query analyzer to get the execution plan for a batch of the two query formats. I checked with a simple query, and the execution plan showed SQL will use the >= and <= operators in both statements, and they both get 50% of the cost.