Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Compare timestamp and date and get the greatest among the two dates

866081Mar 3 2016 — edited Mar 3 2016

I have two date columns TS1 ( Datatype - Timestamp) and TS2( Datatype - DATE)

Need to compare both and get the Max of them

TS1(Timestamp)TS2(Date)
01-MAR-16 01.20.07.353515000 PM1-Mar-16
01-MAR-16 01.20.22.320839000 PM1-Mar-16
01-MAR-16 01.20.35.443564000 PM2-Mar-16
02-MAR-16 12.29.30.244556000 PM2-Mar-16
01-MAR-16 11.38.29.391434000 AM1-Mar-16
Ouput
01-MAR-16 01.20.07.353515000 PM
01-MAR-16 01.20.22.320839000 PM
02-MAR-16 00.00.00.000000000 AM
02-MAR-16 12.29.30.244556000 PM
01-MAR-16 11.38.29.391434000 AM

Thanks in advance.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 31 2016
Added on Mar 3 2016
5 comments
5,520 views