SELECT * FROM sometable
WHERE date <= '2009-04-15'
AND date >= '2009-04-01'
An alternative way to construct the above query is by using the BETWEEN statement:
SELECT * FROM sometable
WHERE date BETWEEN '2009-04-01' AND '2009-04-15'
SELECT * FROM sometable
WHERE date <= '2009-04-15'
AND date >= '2009-04-01'
SELECT * FROM sometable
WHERE date BETWEEN '2009-04-01' AND '2009-04-15'
I am totally gonna use the bejeezus out of this construct from now on.
ReplyDeletewhich query is faster both query...
ReplyDelete