Received: from multivac.embryo.se (multivac.embryo.se [195.149.181.2]) by postgresql.org (Postfix) with ESMTP id 5FC52475924 for ; Wed, 10 Apr 2002 07:42:09 -0400 (EDT) Received: from tubalon.embryo.se ([172.16.0.67]) by multivac.embryo.se with esmtp (Exim 3.12 #1 (Debian)) id 16vGUK-0005hN-00; Wed, 10 Apr 2002 13:42:08 +0200 User-Agent: Microsoft-Entourage/10.0.0.1309 Date: Wed, 10 Apr 2002 13:42:05 +0200 Subject: Re: replace NULL From: Torbj=?ISO-8859-1?B?9g==?=rn Andersson To: "Kancha ." , Message-ID: In-Reply-To: <005501c1e076$f9f60fe0$5ce8fea9@GMENDOLA2> Mime-version: 1.0 Content-type: text/plain; charset="ISO-8859-1" Content-transfer-encoding: quoted-printable X-Archive-Number: 200204/116 X-Sequence-Number: 7381 Hi, =20 >> if age is NULL then I want to replace it by some text, >> say "SHY" so the output is like >>=20 >> name age >> me 10 >> jane SHY >> jack 32 If you want to change the presentation but not the actual data you can use: SELECT name, CASE=20 WHEN age IS NULL THEN 'SHY'=20 ELSE age=20 END AS age FROM people I think there is a function called coalesce (sp?) that does roughly the same as the CASE-clause above. Best Regards Torbj=F6rn "Toby" Andersson --------------------------------------------------- Embryo Communication phone: +46 (0) 31-774 39 11(00) Kungsgatan 7a fax: +46 (0)31 774 07 80 S-411 19 Gothenburg mobile: 0708-30 70 04 Sweden home: http://www.embryo.se/ mail: torbjorn.andersson@embryo.se --------------------------------------------------- "A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects"