Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: nvl /min function question
A copy of this was sent to iancrozier_at_aol.com (Iancrozier)
(if that email address didn't require changing)
On 23 Jun 1998 14:22:46 GMT, you wrote:
>I have been trying to run a PL/SQL program where I am looking for a minimum
>value of a column in a table which is greater than a certain other value. In
>some cases I get a null value, so I would like to use nvl to change the null
>values to the same constant. So, my question, is it possible to "wrap" the nvl
>function around the min function. I have tried to use something like
>select nvl(min(A),99999) into v_A from TABLE where A > B;
>
>but that doesn't work. What should I do instead?
>
>TIA
Why doesn't it work? whats the error message? For example:
SQL> select nvl( min(dummy), 'A' ) from dual;
N
-
X
SQL> select nvl( min(dummy), 'A' ) from dual where 1 = 0;
N
-
A
Shows that it does work...
Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA
http://govt.us.oracle.com/ -- downloadable utilities
Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Tue Jun 23 1998 - 11:26:24 CDT