2011-03-08 84 views

回答

3

更好的解決方案是使用WHERE col >= '2011-02-21' AND col < '2011-02-22',因此MySQL可以使用一個索引,如果有一個存在。

+0

是的,因爲每個人都應該[連續寫入查詢作爲明確的範圍條件](http://use-the-index-luke.com/sql/where-clause/obfuscation/dates)。 – 2011-03-08 06:55:12

3
... where date(datetime_column) = '2011-02-21' 

Here是文檔