Solved

ORACLE DATE / TIME

Posted on 2013-12-21
3
743 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Azure Functions is a solution for easily running small pieces of code, or "functions," in the cloud. This article shows how to create one of these functions to write directly to Azure Table Storage.
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

739 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