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!

Maximum date from multiple columns

rade.todorovichFeb 20 2015 — edited Feb 21 2015

Oracle DB 12c

I have a table with 3 date columns (at least); Any of the date values can be NULL. I want to select the greatest date out of the 3 columns. Cannot use GREATEST since NULLs exist. I would also like to avoid using SELECT CASE which may work in 3 columns but wondering if there exist better method that can work for any number of date columns?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 21 2015
Added on Feb 20 2015
6 comments
2,020 views