Re: Fwd: Question - Mailing list pgsql-admin

From Michael Fuhr
Subject Re: Fwd: Question
Date
Msg-id 20060308172412.GB45820@winnie.fuhr.org
Whole thread Raw
In response to Re: Fwd: Question  ("Goulet, Dick" <DGoulet@vicr.com>)
List pgsql-admin
On Wed, Mar 08, 2006 at 09:07:00AM -0500, Goulet, Dick wrote:
> The syntax in Oracle is "is null" or "is not null" as in:
>
> select count(*) from module_master where gatekeeper_status is null;

That works if you want to exclude those rows altogether.

> And yes that does work in PostGreSql.  Now if your talking about the
> Oracle function NVL, for Null Value, no that does not work and I don't
> see a similar function in PostGreSql.  You could create one easily
> enough.

What does NVL do?  From the examples I've seen it looks like COALESCE.
Oracle themselves recommends COALESCE:

http://www.oracle.com/technology/oramag/oracle/05-jul/o45sql.html

"Oracle Database supports several functions that are similar to
COALESCE.  These include NVL2, NULLIF, and NVL.  (Take time to read
about these functions in the Oracle SQL Reference manual.)  We
recommend COALESCE over NVL, because COALESCE can handle more than
just two arguments and it's part of the SQL standard.  When COALESCE
isn't enough, you may be able to find refuge in CASE expressions,
which are also covered in Oracle SQL Reference."

PostgreSQL supports CASE as well.

--
Michael Fuhr

pgsql-admin by date:

Previous
From: "Goulet, Dick"
Date:
Subject: Re: Fwd: Question
Next
From: Andy Shellam
Date:
Subject: Re: postgresql-8.0.1/Solaris 9/Readline-5.1