简体   繁体   中英

How to compare difference between two date time stamp in Oracle SQL?

I have 02 columns, TradeDate and TradeExecDate with format in dd-MMM-yy HH.mm.ss.00000000 AM/PM How do I get to find the difference between the date timestamp is greater than 01.

That is the TradeDate and TradeExecDate are different, not same date but different date.

Tx

As you have timestamps, the difference is an interval datatype :

SELECT *
FROM   your_table
WHERE  TradeExecDate - TradeDate > interval '1' day

Read more about datetime/interval arithmetic.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM