Re: replace NULL

Поиск
Список
Период
Сортировка
От Andreas Joseph Krogh
Тема Re: replace NULL
Дата
Msg-id 200204091414.49688.andreak@officenet.no
обсуждение исходный текст
Ответ на replace NULL  ("Kancha ." <kancha2np@yahoo.com>)
Список pgsql-sql
On Tuesday 09 April 2002 14:00, Kancha . wrote:
> Hello
>
> i want to run a select query on a table. eg:
>
> select age from people;
>
> if age is NULL then I want to replace it by some text,
> say "SHY" so the output is like
>
> name age
> me   10
> jane SHY
> jack 32
>
> how do i make this replacement of null value to some text
>

select name, COALESCE(age, 'SHY') from people;

--
Andreas Joseph Krogh (Senior Software Developer) <andreak@officenet.no>
A hen is an egg's way of making another egg.


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

Предыдущее
От: "Kancha ."
Дата:
Сообщение: replace NULL
Следующее
От: "Gautham S. Rao"
Дата:
Сообщение: Hierarchical Queries