Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> getting records for 1 day

getting records for 1 day

From: Summercool <Summercoolness_at_gmail.com>
Date: Sun, 04 Nov 2007 11:45:07 -0000
Message-ID: <1194176707.385279.102190@t8g2000prg.googlegroups.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US