Hi,
To return one value not null, i've created a function :
CREATE FUNCTION isnull (int4,int4 ) RETURNS int4 AS '
BEGIN
IF ($1 IS NULL) THEN
RETURN $2;
ELSE
RETURN $1;
END IF;
END;
' LANGUAGE 'plpgsql';
select isnull(my_int,0) as number, sample_id from my_table;
but I got
number |sample_id
------+---------
| 13
| 15
What should I do to have '0' in the column 'number' instead of NULL ?
Thanks,
nuch