Solved

ORACLE DATE / TIME

Posted on 2013-12-21
3
737 Views
Last Modified: 2013-12-22
Hi,
I have a table with field INSERT_DATE" TIMESTAMP(6), adding the date/time when the record was inserted.
 I need to list the records older than 24 and 48 hours...
Thank you
0
Comment
Question by:andrejaTJ
3 Comments
 
LVL 74

Assisted Solution

by:sdstuber
sdstuber earned 125 total points
ID: 39733554
select * from yourtable where insert_date < systimestamp - interval '24' hour;

select * from yourtable where insert_date < systimestamp - interval '48' hour;
0
 
LVL 32

Expert Comment

by:awking00
ID: 39733706
Records older than 24 hours would include records older than 48 hours. Can you describe how you would like the output to be?
0
 
LVL 38

Accepted Solution

by:
Gerwin Jansen, EE MVE earned 125 total points
ID: 39734686
-- select records older than 24 hours
select * from your_table
where  INSERT_DATE < sysdate -1;

-- select records older than 48 hours
select * from your_table
where  INSERT_DATE < sysdate -2;
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question