• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 772
  • Last Modified:

ORACLE DATE / TIME

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
andrejaTJ
Asked:
andrejaTJ
2 Solutions
 
sdstuberCommented:
select * from yourtable where insert_date < systimestamp - interval '24' hour;

select * from yourtable where insert_date < systimestamp - interval '48' hour;
0
 
awking00Commented:
Records older than 24 hours would include records older than 48 hours. Can you describe how you would like the output to be?
0
 
Gerwin Jansen, EE MVETopic Advisor Commented:
-- 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now