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

From: Robin Thomas <rthomas(at)azstarnet(dot)com>
To: "Jose' Soares Da Silva" <sferac(at)bo(dot)nettuno(dot)it>
Cc: pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] COALESCE() or NVL()
Date: 1998-06-18 20:44:48
Message-ID: 199806182052.NAA13301@cepheus.azstarnet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Yuichiro Kinoshita 1998-06-18 21:09:32
Previous Message eric 1998-06-18 19:31:11 Help with auto-increment

Browse pgsql-hackers by date

  From Date Subject
Next Message Maarten Boekhold 1998-06-18 20:59:29 Re: [HACKERS] minor improvement to libpq++ ...
Previous Message Charles Bennett 1998-06-18 17:35:37 Re: [BUGS] Re: [HACKERS] pg_dump error