From: Olaf Zanger <olaf.zanger@soli-con.com>
To: Tod McQuillin <devin@spamcop.net>
Cc: pgsql-sql@postgresql.org
Subject: Re: sum(bool)?
Date: Fri, 23 Feb 2001 16:58:06 +0100
Message-ID: <3A96888E.2292D998@soli-con.com> (raw)
References: <Pine.GSO.4.31.0102230941300.13223-100000@sysadmin>
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@soli-con.com
mailto:olaf.zanger@soli-con.com
http://www.soli-con.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: olaf.zanger@soli-con.com, devin@spamcop.net
Subject: Re: sum(bool)?
In-Reply-To: <3A96888E.2292D998@soli-con.com>
References: <Pine.GSO.4.31.0102230941300.13223-100000@sysadmin> <3A96888E.2292D998@soli-con.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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