null handling with greatest function
Ora_DBADec 7 2009 — edited Dec 8 2009Hi , 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