Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> getting records for 1 day
in SQL, i wonder if I do a
select * from tablefoo where add_date = "2007-11-01"
then it may not show any record as it will only match recorded added
exactly at 2007-11-01 00:00:00
so to limit that day, I could use
select * from tablefoo where date(add_date) = "2007-11-01"
except I think if the table has millions of records, then it can take forever to run, as it will go through all records and apply the date function on each record's add_date.
so the following
select * from tablefoo where add_date >= "2007-11-01" and add_date < "2007-11-02"
should work... except it is quite verbose... i wonder if there is a better way? Received on Sun Nov 04 2007 - 05:45:07 CST
![]() |
![]() |