BETWEEN vs > AND < | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

BETWEEN vs > AND <

Does anyone know which performs better- ‘BETWEEN’ or ‘> AND <‘ eg Select *
FROM table
WHERE date BETWEEN 01/01/2004 AND 10/01/2004 OR SELECT *
FROM TABLE
WHERE date > 01/01/2004 AND < 10/01/2004 ??? Thanks in advance
Ben
(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.

]]>