Re: Replace NULL values - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Replace NULL values
Date
Msg-id 20060907094714.GD10093@svana.org
Whole thread Raw
In response to Replace NULL values  (Stefan Schwarzer <stefan.schwarzer@grid.unep.ch>)
Responses Re: Replace NULL values  (Stefan Schwarzer <stefan.schwarzer@grid.unep.ch>)
List pgsql-general
On Thu, Sep 07, 2006 at 07:45:19AM +0200, Stefan Schwarzer wrote:
> Hi there,
>
> is there a simple way to replace NULL values in multiple columns
> within the SQL statement? I changed the underlaying country template
> of your database; so now there are a couple of NULL values when I
> join the stats-table with the country table. Unfortunately, my
> queries have always multiple (year) columns, so I can't do a kind of
> manual replace.
>
> I found that the COALESCE command does something like this, but I
> couldn't figure out how this works.

Yes, COALESCE replaces NULLs, however your examples have neither NULLs
nor use COALESCE, so I don't understand what your question is.

Please repost with an actual example of your problem.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment

pgsql-general by date:

Previous
From: Alban Hertroys
Date:
Subject: Re: Problems with sequences
Next
From: Stefan Schwarzer
Date:
Subject: Re: Replace NULL values