Which is Stmt Faster ? ''BETWEEN'' or '' =''

  • In a query which is better to use:

    1. SELECT *from sample

    where

    created_date between '01/01/2006' and '02/01/2006'

    OR

    2. SELECT *from sample

    where

    created_date >= '01/01/2006'

    created_date <= '02/01/2006'

     

  • I'm pretty sure there's no difference whatsoever speed-wise - they will be interpreted in exactly the same way. I prefer between from a readability point of view, but that's just my preference in my circumstances.

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • I've found that when the date is in a clustered index on SQL2000 I got slightly better performance with BETWEEN.

    I tend to use BETWEEN because it makes the code more readable.

    In SQL2005 it makes no difference what-so-ever

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply