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: query last n hours / minutes

Re: query last n hours / minutes

From: Rene Nyffenegger <rene.nyffenegger_at_gmx.ch>
Date: Fri, 29 Jul 2005 05:43:27 +0000 (UTC)
Message-ID: <dccflv$nq0$1@klatschtante.init7.net>


On 2005-07-29, Harry <harryooopotter_at_hotmail.co_> wrote:
> I have an Oracle 9 table with a field performed_date.
>
> Select * from my_table
> where performed_date > (sysdate - 8);
>
> This will return all records with performed_date within last week.
>
> What is the query for "last 4 hours"?
>
> What is the query for "last 30 minutes"?

That sounds a lot like homework.

So, sysdate-1 returns all rows in the
last 24 hours. sysdate-1/6 will
return all row in the last 24/6 hours
(=4 hours).

Did that help?

-- 
  Rene Nyffenegger
  http://www.adp-gmbh.ch/
Received on Fri Jul 29 2005 - 00:43:27 CDT

Original text of this message

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