Solved

ORACLE DATE / TIME

Posted on 2013-12-21
3
748 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

Get Database Help Now w/ Support & Database Audit

Keeping your database environment tuned, optimized and high-performance is key to achieving business goals. If your database goes down, so does your business. Percona experts have a long history of helping enterprises ensure their databases are running smoothly.

Question has a verified solution.

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

When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

717 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