February 10, 2009 at 8:41 am
Does anyone know if there is a difference in performance using between in your where clause vs >= and <=. For example:
select column from table where recdate between '2/1/09' and '2/10/09'
vs
select column from table where recdate >= '2/1/09' and recdate <= '2/10/09'
We tested both and they returned a result set in the same amount of time and the query plan looked the same.
Thanks
Elaine
February 10, 2009 at 8:42 am
SQL Server translates "between" into the other at runtime. No difference except possibly readability.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
February 10, 2009 at 8:48 am
Thank you!
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply