From: | Martijn van Oosterhout <kleptog(at)svana(dot)org> |
---|---|
To: | Stefan Schwarzer <stefan(dot)schwarzer(at)grid(dot)unep(dot)ch> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Replace NULL values |
Date: | 2006-09-07 09:47:14 |
Message-ID: | 20060907094714.GD10093@svana.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.
From | Date | Subject | |
---|---|---|---|
Next Message | Stefan Schwarzer | 2006-09-07 09:54:43 | Re: Replace NULL values |
Previous Message | Alban Hertroys | 2006-09-07 09:35:30 | Re: Problems with sequences |