NULL values

Started by Mark Muffettalmost 25 years ago3 messagesgeneral
Jump to latest
#1Mark Muffett
markm@muffett.net

A simple question:

Is there a Postgresql equivalent to the Oracle NVL( ) function, which allows a SELECT statement to fill in default values if a column is NULL?

Thanks for any help

Mark Muffett

#2Bruno Wolff III
bruno@wolff.to
In reply to: Mark Muffett (#1)
Re: NULL values

On Tue, Jul 10, 2001 at 06:45:29PM +0100,
Mark Muffett <markm@muffett.net> wrote:

A simple question:

Is there a Postgresql equivalent to the Oracle NVL( ) function, which allows a SELECT statement to fill in default values if a column is NULL?

coalesce will return the first nonnull argument.

#3Peter Eisentraut
peter_e@gmx.net
In reply to: Mark Muffett (#1)
Re: NULL values

Mark Muffett writes:

Is there a Postgresql equivalent to the Oracle NVL( ) function, which
allows a SELECT statement to fill in default values if a column is
NULL?

COALESCE(x1, x2, x3, ...)

returns the first xn that is not null.

--
Peter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter