On Fri, Feb 22, 2013 at 9:56 AM, jose isaias cabrera
<cabr...@wrc.xerox.com> wrote:
>
> Greetings.
>
> which one is faster...
>
> #1.
>
> SELECT id FROM LSOpenJobs WHERE bdate BETWEEN '2012-01-01' AND '2012-12-31';
>
> or this one...
>
> #2
>
> SELECT id FROM LSOpenJobs WHERE bdate IN ('2012-01-01', ..., '2012-12-31)';
>
> where , ..., would have all the rest of the dates.  Thanks.
>
> josé

This is a great opportunity to learn the Try It And See approach.

Note that:
- The first query will only perform 2 comparisons.
- The second query will perform 31 comparisons.
- Dates are not strongly-typed in SQLite, so this will perform string
comparisons without any special handling.

-- 
Cory Nelson
http://int64.org
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to