I found that when you use BETWEEN it doesn't matter which of the two values
is first and which is second.
BETWEEN 1 AND 100 gives the same result as
BETWEEN 100 AND 1
(I tested this with dates, I think it would be the same for other data
types.)
Don't know which code runs faster.
If you have a large table to test on, you might find a difference.
If your table doesn't show a difference, then - both ways are fast!
Bruce Pick
"Marek Kotowski" <Ma************@wsip.com.pl> wrote in message
news:e5**************************@posting.google.c om...
What is the real difference between:
1. SELECT something1 FROM something2 WHERE Value >= 1 AND Value <= 1000
2. SELECT something1 FROM something2 WHERE Value BETWEEN 1 AND 1000
In what way 2. is better than 1.?
Thanks in advance
Marek Kotowski
Warsaw