Re: replace NULL

From: "Gaetano Mendola" <mendola(at)bigfoot(dot)com>
To: "Kancha (dot)" <kancha2np(at)yahoo(dot)com>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: replace NULL
Date: 2002-04-10 10:03:34
Message-ID: 005501c1e076$f9f60fe0$5ce8fea9@GMENDOLA2
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"Kancha ." <kancha2np(at)yahoo(dot)com> 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

UPDATE people
SET age = 'SHY'
WHERE age IS NULL;

I hope that the field age is a text field;

Ciao
Gaetano

--
#exclude <windows>
#include <CSRSS>
printf("\t\t\b\b\b\b\b\b");.
printf("\t\t\b\b\b\b\b\b");

In response to

Responses

  • Re: replace NULL at 2002-04-10 11:42:05 from Torbj=?ISO-8859-1?B?9g==?=rn Andersson

Browse pgsql-sql by date

  From Date Subject
Next Message Bernd von den Brincken 2002-04-10 10:24:26 Optimizer for IN (..) ? / Re: Thank you ! Re: Is there any Faster workaround ??
Previous Message Pierre-Andre Michel 2002-04-10 07:48:47 How to use an index on a bigint column