Re: replace NULL - Mailing list pgsql-sql

From Andreas Joseph Krogh
Subject Re: replace NULL
Date
Msg-id 200204091414.49688.andreak@officenet.no
Whole thread Raw
In response to replace NULL  ("Kancha ." <kancha2np@yahoo.com>)
List 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 by date:

Previous
From: "Kancha ."
Date:
Subject: replace NULL
Next
From: "Gautham S. Rao"
Date:
Subject: Hierarchical Queries