Re: [GENERAL] COALESCE() or NVL()

From: Summer <summerd(at)cs(dot)unm(dot)edu>
To: Robin Thomas <rthomas(at)azstarnet(dot)com>
Cc: "Jose' Soares Da Silva" <sferac(at)bo(dot)nettuno(dot)it>, pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] COALESCE() or NVL()
Date: 1998-07-16 21:15:21
Message-ID: Pine.SGI.3.96.980716151253.19661C-100000@waimea.cs.unm.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers


I am trying to use the nvl function with no success
when I say:
select bar, NVL(foo, 0) from nulltest;
I get the error:
ERROR: function nvl(int4, int4) does not exist

Does anyone have any suggestions?
Summer

On Thu, 18 Jun 1998, Robin Thomas wrote:

> At 12:03 PM 6/17/98 +0000, Jose' Soares Da Silva wrote:
> >> Jose' Soares Da Silva writes:
> >> > SELECT name,NVL(salary)+100 AS dream FROM emp;
> >> > name |dream
> >> > -----------+-----
> >> > Sam | 1300
> >> > Claire | 5100
> >> > Bill | 4300
> >> > Ginger | 4900
> >> > NULL VALUES| <--- I expected 100 here.
> >> > (5 rows)
>
> SELECT name, NVL(salary, 0) + 100 AS dream FROM emp;
>
> NVL() takes two values: the column/variable, and the value to use if NULL.
>
> --
> Robin Thomas
> rthomas(at)azstarnet(dot)com
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message James Olin Oden 1998-07-16 21:56:32 Re: [GENERAL] Autonumbering column
Previous Message Fandarel 1998-07-16 18:50:39 Re: [GENERAL] listing all tables

Browse pgsql-hackers by date

  From Date Subject
Next Message t-ishii 1998-07-17 01:37:24 aborting create table in the middle of process
Previous Message Bruce Momjian 1998-07-16 18:37:17 Re: [INTERFACES] Re: [HACKERS] changes in 6.4