Re: Replace NULL values - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Replace NULL values
Date
Msg-id 20060907101119.GE10093@svana.org
Whole thread Raw
In response to Re: Replace NULL values  (Stefan Schwarzer <stefan.schwarzer@grid.unep.ch>)
List pgsql-general
On Thu, Sep 07, 2006 at 11:54:43AM +0200, Stefan Schwarzer wrote:
> As I said, I couldn't figure out how COALESCE would work on multiple
> columns (without naming them explicitly).
>
> So, say I have a table with columns for each year between 1970 and
> 2005. For specific countries the values might be NULL, depending if
> the statistical table has been updated recently (then they will have
> a value), or not (then they will be NULL). A sample query would thus
> be something like:
>
>     SELECT * FROM pop_density

Ah, your data is denormalised. SQL doesn't handle that kind of data
very well at all. A user-defined function should be able to handle that
though (not pl/pgsql).

Hope this helps,

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: Stefan Schwarzer
Date:
Subject: Re: Replace NULL values
Next
From: Sim Zacks
Date:
Subject: Re: Replace NULL values