From: Michael Fuhr <mike@fuhr.org>
To: Goulet, Dick <DGoulet@vicr.com>
Cc: German Raul Hoyos Parravicino <rhoyos@gmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Fwd: Question
Date: Wed, 8 Mar 2006 10:24:12 -0700
Message-ID: <20060308172412.GB45820@winnie.fuhr.org> (raw)
In-Reply-To: <4001DEAF7DF9BD498B58B45051FBEA650340B9B9@25exch1.vicorpower.vicr.com>
References: <4001DEAF7DF9BD498B58B45051FBEA650340B9B9@25exch1.vicorpower.vicr.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: mike@fuhr.org, DGoulet@vicr.com, rhoyos@gmail.com
Subject: Re: Fwd: Question
In-Reply-To: <20060308172412.GB45820@winnie.fuhr.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox