Skip to Main Content

Oracle Database Discussions

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!

null handling with greatest function

Ora_DBADec 7 2009 — edited Dec 8 2009
Hi , My oracle version is 10.2 and I am trying to get max value from three dates.

col1, col2, col3 max_date
*12/4/2007 12/5/2009 7:14:57 PM*

col1 value is null . so when I use below sql

select greatest(NVL(col1,col2)) from temp_greatest where rec_id=366957734, I got value 12/4/2007

I want to get max date from col1,col2 and col3, even though col1 is null.

I have couple of rows with col2 acnd col3 as null values.

How to get the max values.. any help appreciate

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 5 2010
Added on Dec 7 2009
7 comments
3,074 views