Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Can in anyway use LEAST () with a null value???

Can in anyway use LEAST () with a null value???

From: Bliss <bliss_is_ignorance_at_hotmail.com>
Date: Fri, 2 Nov 2001 02:07:59 +0800
Message-ID: <3be18f2d_2@news.tm.net.my>


Hi all,

In a PL/SQL block I have four date type variables.... At any given point of time atleast one variable will have some data in it, the other three may have values or may be null e.g.

date_1 := '01-may-2001';
date_2 := null;
date_3 := '01-sep-2001';
date_4 := '01-jan-2001';

I have to find the lowest amongst these dates... I can't use LEAST () because of the null value... I've tried racking my brains (??!!!) will all kind of combination of NVL () and DECODE () with LEAST ()... but could not get a solution... So finally I stuck to good 'ol IF..THEN... However I have a great feeling that I'm missing out on something... There must be some way to get the lowest value using LEAST () and taking care of the nulls... Any suggestions anyone????

Thanks for your attention....

Regards,
Bliss Received on Thu Nov 01 2001 - 12:07:59 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US