Re: problem with date in oracle 10g

From: <>
Date: Fri, 4 Jan 2008 05:23:37 -0800 (PST)
Message-ID: <>

Hi All,

    I have a doubt. I am writing a function which has to get the greatest date value among the columns in a row. say there are 5 columns. I have to get the greatest date of those 5 columns and display the result.

There might be chance that the date values might be null. In case if some two column values are null and other three have some date values i need to get the greatest of those three.

In case if all are null the result will be null. Please some one help me in writing the function in Oracle to get the greatest date from 7 parameters passed inside which are all of Type Date.

Say the input is

Date1	    Date2	        Date3       Date4        Date5
Date6	Date7
12/12/2008  01/01/2007       null	         null	       3/3/2006
10/10/2008	null
null	      null	         null	     3/09/2004    null	           null
01/04/2006      null	         null	         null
4/04/2006        null	null

The ouput should be like this


Please some one give me a way for this. Received on Fri Jan 04 2008 - 07:23:37 CST

Original text of this message