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: signature.asc
Description: Digital signature

Reply via email to