Re: sum(bool)?

From: "Oliver Elphick" <olly(at)lfix(dot)co(dot)uk>
To: olaf(dot)zanger(at)soli-con(dot)com
Cc: PgSQL-SQL <pgsql-sql(at)postgresql(dot)org>
Subject: Re: sum(bool)?
Date: 2001-02-26 15:01:23
Message-ID: 200102261502.f1QF1Ow03662@linda.lfix.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Olaf Marc Zanger wrote:
>hi there,
>
>i want to add up the "true" values of a comparison like
>
>sum(a>b)
>
>it just doesn't work like this
>
>any workaround?

select count(*) where a > b;

--
Oliver Elphick Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
Isle of Wight http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47 6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"But God commendeth his love toward us, in that, while
we were yet sinners, Christ died for us."
Romans 5:8

Browse pgsql-sql by date

  From Date Subject
Next Message Michael Fork 2001-02-26 15:05:22 Re: distinct date problem
Previous Message Jaume Teixi 2001-02-26 10:48:12 Re: NOSUCCESS: m$ access -> psql howto ?