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: DA Morgan <damorgan_at_psoug.org>
Date: Tue, 31 Jul 2007 20:03:07 -0700
Message-ID: <1185937379.341994@bubbleator.drizzle.com>


Mark Harrison 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

Looks reasonable to me though I might be inclined to perform the calculation one time and assign the value to a variable just to make the logic more explicit.

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Tue Jul 31 2007 - 22:03:07 CDT

Original text of this message

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