Re: Fwd: Question

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: "Goulet, Dick" <DGoulet(at)vicr(dot)com>
Cc: German Raul Hoyos Parravicino <rhoyos(at)gmail(dot)com>, pgsql-admin(at)postgresql(dot)org
Subject: Re: Fwd: Question
Date: 2006-03-08 17:24:12
Message-ID: 20060308172412.GB45820@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Andy Shellam 2006-03-08 17:49:56 Re: postgresql-8.0.1/Solaris 9/Readline-5.1
Previous Message Goulet, Dick 2006-03-08 14:07:00 Re: Fwd: Question