select
in MySQL
Select date
from datetime
with index
select * from data
where datetime >= '2000-01-01' and datetime < '2000-01-02'
or
select * from data
where datetime >= '2000-01-01' and datetime < date_add('2000-01-01', interval 1 day)
or
select * from data
where datetime between '2000-01-01 00:00:00' and '2000-01-01 23:59:59'
caution
date(datetime)
cannot use index, that calculatedate()
of all rows firstdatetime like '2000-01-01%'
cannot use index, that check all rows if the pattern matching first