Received: from dell-laptop01.officenet.no (dell-laptop01.officenet.no [193.212.174.122]) by postgresql.org (Postfix) with ESMTP id 2D6ED4758F3 for ; Tue, 9 Apr 2002 08:14:54 -0400 (EDT) Received: by dell-laptop01.officenet.no (Postfix, from userid 502) id 13B3350438; Tue, 9 Apr 2002 14:14:50 +0200 (CEST) Content-Type: text/plain; charset="iso-8859-1" From: Andreas Joseph Krogh Organization: OfficeNet AS To: "Kancha ." , pgsql-sql@postgresql.org Subject: Re: replace NULL Date: Tue, 9 Apr 2002 14:14:49 +0200 X-Mailer: KMail [version 1.4] References: <20020409120003.46895.qmail@web14910.mail.yahoo.com> In-Reply-To: <20020409120003.46895.qmail@web14910.mail.yahoo.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200204091414.49688.andreak@officenet.no> X-Archive-Number: 200204/96 X-Sequence-Number: 7361 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; --=20 Andreas Joseph Krogh (Senior Software Developer) A hen is an egg's way of making another egg.