Re: sum(bool)?

From: Olaf Zanger <olaf(dot)zanger(at)soli-con(dot)com>
To: Tod McQuillin <devin(at)spamcop(dot)net>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: sum(bool)?
Date: 2001-02-23 15:58:06
Message-ID: 3A96888E.2292D998@soli-con.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

hi there,

soooo cool,
this works streight away and took 5 min. waiting for a answer :-)

thanks very much to you tod personal and the mailing list for existence.

Olaf

Tod McQuillin schrieb:
>
> On Fri, 23 Feb 2001, Olaf Zanger wrote:
>
> > i'd like to add up the "true" values of a comparison like
> >
> > sum(a>b)
> >
> > it just doesn't work like this
>
> Try
>
> sum(case when a>b then 1 else 0 end)
> --
> Tod McQuillin

--
soli-con Engineering Zanger
Dipl.-Ing. (FH) Olaf Marc Zanger
Lorrainestrasse 23
3013 Bern / Switzerland
Fon: +41-31-332 9782
Mob: +41-76-572 9782
mailto:info(at)soli-con(dot)com
mailto:olaf(dot)zanger(at)soli-con(dot)com
http://www.soli-con.com

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Peter Eisentraut 2001-02-23 16:06:01 Re: sum(bool)?
Previous Message Daniel Wickstrom 2001-02-23 15:45:11 sum(bool)?