Re: Replace NULL values

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Replace NULL values
Дата
Msg-id 20060907101119.GE10093@svana.org
обсуждение исходный текст
Ответ на Re: Replace NULL values  (Stefan Schwarzer <stefan.schwarzer@grid.unep.ch>)
Список 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.

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: Stefan Schwarzer
Дата:
Сообщение: Re: Replace NULL values
Следующее
От: Sim Zacks
Дата:
Сообщение: Re: Replace NULL values