Re: Fwd: Question

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: Fwd: Question
Дата
Msg-id 20060308172412.GB45820@winnie.fuhr.org
обсуждение исходный текст
Ответ на Re: Fwd: Question  ("Goulet, Dick" <DGoulet@vicr.com>)
Список 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 по дате отправления:

Предыдущее
От: "Goulet, Dick"
Дата:
Сообщение: Re: Fwd: Question
Следующее
От: Andy Shellam
Дата:
Сообщение: Re: postgresql-8.0.1/Solaris 9/Readline-5.1