SQL Language (MOSC)

MOSC Banner

has anybody ever seen this way to keep track of time

edited Jan 28, 2013 7:08AM in SQL Language (MOSC) 2 commentsAnswered
delete TABLE_A                                                                                                                                               where TO_TIMESTAMP('01/01/0001','MM/DD/YYYY') + MSG_TIMESTAMP/864000000000 + 60 < systimestamp;   

I have this statement in a db.  TABLE_A has messages ( not AQ ) and it uses a column with a number datatype to keep track of time, i.e. MSG_TIMESTAMP:

Look at the number , I realized that it’s the number of seconds in a day times 1 million from research:

864,000,000,000 = 60 * 60 * 24 * 1000000
60 * 60 * 24 = the number of seconds in a day.

I believe this has something to do with the way Windows keeps track of time.

How does this statement work and how can I get an Oracle date out of it with this format DD-MON-YY ?

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center