Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f9H6ZKP25421 for ; Wed, 17 Oct 2001 02:35:20 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.4/8.11.4) id f9H6C4498901 for pgsql-sql@postgresql.org; Wed, 17 Oct 2001 02:12:04 -0400 (EDT) (envelope-from news) From: "Andre Schnabel" X-Newsgroups: comp.databases.postgresql.sql Subject: Re: nvl() function Date: Wed, 17 Oct 2001 08:11:56 +0200 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 41 Message-ID: <9qj7fj$30ii$1@news.tht.net> References: <9qj13u$2v5l$1@news.tht.net> X-Complaints-To: scrappy@hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 To: pgsql-sql@postgresql.org X-Archive-Number: 200110/227 X-Sequence-Number: 5182 Hi Steven, you may use COALESCE. This function should have the same behaviour as Oracle's nvl. For documentation look at http://www.postgresql.org/idocs/index.php?functions-conditional.html Andre "Steven Dahlin" schrieb im Newsbeitrag news:9qj13u$2v5l$1@news.tht.net... > I am trying to find the equivalent in Postgresql to the Oracle sql function > nvl(). With nvl() you give two parameters. The first may be a field/column > or variable. If the value is not null then it is returned by the function. > For example the with query below if the :ClientParameter is passed then only > those rows which have a clientdesc matching the parameter are returned. If > the :ClientParameter is null then those rows which have clientdesc = > clientdesc are returned (all rows): > > select clientid, > clientdesc > from clients > where ( clientdesc = nvl( :ClientParameter, clientdesc ) ) > > I have looked thru all the documentation I could find but nowhere were any > built-in SQL functions delineated. Does anyone know where the documentation > can be found? > > Thanks, > Steve > >