Re: Optimizing WHERE computations
This should be simlpe enough
SELECT id FROM foo
WHERE dt >= CURDATE() AND dt < CURDATE() + interval 1 day
Make sure the left hand side of the comparison conatain only the fieldname, dt, if you use a function, like date(dt), the index cannot be used anymore, as shown in the previous example by Felix
Subject
Views
Written By
Posted
2234
May 30, 2005 11:48AM
1551
May 30, 2005 06:52PM
1719
May 31, 2005 04:52AM
1570
May 31, 2005 05:35AM
1586
May 31, 2005 07:08AM
1184
May 31, 2005 07:11AM
1674
May 31, 2005 10:45AM
Re: Optimizing WHERE computations
1851
May 31, 2005 07:19PM
1669
June 01, 2005 08:53AM
1620
June 02, 2005 06:41PM
1691
June 02, 2005 09:20PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.