Replace null values

Поиск
Список
Период
Сортировка
От Nilesh Govindarajan
Тема Replace null values
Дата
Msg-id 4BA83F80.80101@itech7.com
обсуждение исходный текст
Ответы Re: Replace null values  (John R Pierce <pierce@hogranch.com>)
Список pgsql-general
Hi,

In my query, some rows have null values (length 0).

I wish to replace them with some constant.

I think I am wrong somewhere in this query using coalesce():

select coalesce(u.name, 'anon'), nodecount from users u, ( select n.uid
userid, count(n.nid) nodecount from node n group by n.uid order by n.uid
) t1 where u.uid = t1.userid order by nodecount;

The output is same as that of without coalesce.

--
Nilesh Govindarajan
Site & Server Administrator
www.itech7.com

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

Предыдущее
От: John R Pierce
Дата:
Сообщение: Re: string functions and operators
Следующее
От: John R Pierce
Дата:
Сообщение: Re: Replace null values