MySQL Forums
Forum List  »  Stored Procedures

Re: ISNULL function
Posted by: Joe Aponte
Date: March 23, 2008 12:22PM

Hi friend, i had tested ifnull function with a tipycal example and all right, but i have a problem when the function is evaluating a value returned from a table.
Let me explain that.
My table have two fields:

roos_chamber (depth_cm decimal(4,2),
densidad_r50 decimal (10,3))
example:
--------------------------
dept_cm | densidad_r50 |
1.0 | 1.345 |
2.0 | 1.567 |
2.5 | 1.871 |
--------------------------

and the instruction is:
a) select ifnull(densidad_r50,0) as valor from roos_chamber where depth_cm = 2.5;
b) select ifnull(densidad_r50,0) as valor from roos_chamber where depth_cm = 2.1;

When the value is found (case (a), return the correct value; in otherwise (case (b), is returning null, and i am expecting zero (0).

Do you have any idea?, can you help me?
thanks before hand

Joe
(Web-Bond)

Options: ReplyQuote


Subject
Views
Written By
Posted
319767
February 28, 2008 10:38PM
87793
February 29, 2008 10:15AM
Re: ISNULL function
32619
March 23, 2008 12:22PM
18028
March 23, 2008 01:02PM
12882
March 24, 2008 08:10AM
17558
March 24, 2008 06:05PM
13456
March 25, 2008 12:29PM
16626
March 30, 2009 06:05AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.