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: Harry <harryooopotter_at_hotmail.co_>
Date: Fri, 29 Jul 2005 17:50:57 GMT
Message-ID: <50uGe.196143$on1.14320@clgrps13>


Rene Nyffenegger wrote...
>
>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?

Yes. Thanks for the info.

I was thinking on some difficult ways, like to_min(), to_hr(), or to_char(performed_date) and then compare the date-strings. Received on Fri Jul 29 2005 - 12:50:57 CDT

Original text of this message

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