Oracle sql greatest function null




















Active Oldest Votes. Improve this answer. Llama Mr. Llama 19k 2 2 gold badges 50 50 silver badges bronze badges. David Faber David Faber Alex Poole Alex Poole k 9 9 gold badges silver badges bronze badges. Frosty Z Frosty Z Dennis A. You could try 11g : with x as select 1 as id, sysdate - 30 as col1, sysdate as col2, sysdate as col3,null as col4, sysdate-1 as col5 from dual union select 2 as id, sysdate - 10 as col1, sysdate as col2, null as col3,null as col4, sysdate as col5 from dual union select 3 as id, null as col1, null as col2, null as col3, null as col4, null as col5 from dual select id, max dates from x UNPIVOT INCLUDE NULLS dates FOR colname IN col1,col2,col3,col4,col5 group by id.

Hedinn Hedinn 4 4 silver badges 7 7 bronze badges. I tried this.. HRawashdeh HRawashdeh 1. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. It finds the earliest occurring date. I find that examples are the best way for me to learn about code, even with the explanation above.

This is because the first character of 9 comes after any of the other first characters from other values. Then the comparison is done on the second character.

This is because the first character of 1 comes before any of the other values, except You can fund a full list of Oracle functions here. Your email address will not be published. Notify me of follow-up comments by email. Ex: select greatest 'a', 'b', 'c' , greatest 'satish','srinu','saketh' from dual; output will be greatest 'a', 'b', 'c' c. Tags: string function. Please Share This Share this content Opens in a new window Opens in a new window Opens in a new window Opens in a new window Opens in a new window Opens in a new window Opens in a new window Opens in a new window Opens in a new window Opens in a new window Opens in a new window.

Leave a Reply Cancel reply Comment.



0コメント

  • 1000 / 1000