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

Home -> Community -> Usenet -> c.d.o.misc -> Re: best way to compare date, "more than one minute old"

Re: best way to compare date, "more than one minute old"

From: Rob van Wijk <rwijk72_at_gmail.com>
Date: Wed, 01 Aug 2007 15:05:15 -0000
Message-ID: <1185980715.244148.39170@w3g2000hsg.googlegroups.com>


On 1 aug, 01:58, Mark Harrison <m..._at_pixar.com> wrote:
> I have a table with a DATE field called "started". What's the best
> way to search for rows where started is less than systime - 1 minute?
>
> Here's what I'm using now. Is there a better way?
>
> select * from mytable
> where started<sysdate-(1.0/1440); -- 1440 minutes per day
>
> Many TIA!
> Mark
>
> --
> Mark Harrison
> Pixar Animation Studios

I like the newer interval syntax (from 9i and up) because it is more clear:

select sysdate - interval '1' minute from dual

Regards,
Rob. Received on Wed Aug 01 2007 - 10:05:15 CDT

Original text of this message

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