pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
(non)zero function
3+ messages / 3 participants
[nested] [flat]

* (non)zero function
@ 2005-03-27 15:58  Enrico Weigelt <weigelt@metux.de>
  0 siblings, 2 replies; 3+ messages in thread

From: Enrico Weigelt @ 2005-03-27 15:58 UTC (permalink / raw)
  To: pgsql-sql


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. 


cu
-- 
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service

  phone:     +49 36207 519931         www:       http://www.metux.de/
  fax:       +49 36207 519932         email:     contact@metux.de
  cellphone: +49 174 7066481
---------------------------------------------------------------------
 -- DSL ab 0 Euro. -- statische IP -- UUCP -- Hosting -- Webshops --
---------------------------------------------------------------------



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: (non)zero function
@ 2005-03-27 16:51  Bruno Wolff III <bruno@wolff.to>
  parent: Enrico Weigelt <weigelt@metux.de>
  1 sibling, 0 replies; 3+ messages in thread

From: Bruno Wolff III @ 2005-03-27 16:51 UTC (permalink / raw)
  To: Enrico Weigelt <weigelt@metux.de>; +Cc: pgsql-sql

On Sun, Mar 27, 2005 at 17:58:07 +0200,
  Enrico Weigelt <weigelt@metux.de> 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. 

No.



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: (non)zero function
@ 2005-03-28 08:42  Christian Kratzer <ck-lists@cksoft.de>
  parent: Enrico Weigelt <weigelt@metux.de>
  1 sibling, 0 replies; 3+ messages in thread

From: Christian Kratzer @ 2005-03-28 08:42 UTC (permalink / raw)
  To: Enrico Weigelt <weigelt@metux.de>; +Cc: 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@cksoft.de
CK Software GmbH                        http://www.cksoft.de/
Phone: +49 7452 889 135                 Fax: +49 7452 889 136



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2005-03-28 08:42 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-03-27 15:58 (non)zero function Enrico Weigelt <weigelt@metux.de>
2005-03-27 16:51 ` Bruno Wolff III <bruno@wolff.to>
2005-03-28 08:42 ` Christian Kratzer <ck-lists@cksoft.de>

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