Re: (non)zero function

From: Christian Kratzer <ck-lists(at)cksoft(dot)de>
To: Enrico Weigelt <weigelt(at)metux(dot)de>
Cc: pgsql-sql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: (non)zero function
Date: 2005-03-28 08:42:51
Message-ID: 20050328104059.A93661@vesihiisi.cksoft.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

On Sun, 27 Mar 2005, Enrico Weigelt wrote:

>
> Hi folks,
>
>
> is there an function returning true if the argument is null or
> zero (just to make some queries more concise). Of course its
> trivial to implement as SQL function, but if postgresql already
> provides such a function, I would prefer using it.

Lookup the documentation on COALESCE()

http://www.postgresql.org/docs/current/static/functions-conditional.html
9.13.2. COALESCE

Greetings
Christian

--
Christian Kratzer ck(at)cksoft(dot)de
CK Software GmbH http://www.cksoft.de/
Phone: +49 7452 889 135 Fax: +49 7452 889 136

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Alvaro Herrera 2005-03-28 14:43:35 Re: Executing Anonymous Blocks
Previous Message Chandan_Kumaraiah 2005-03-28 08:32:32 connectby queries