Re: Counting booleans for two columns

From: Rikard Bosnjakovic <rikard(dot)bosnjakovic(at)gmail(dot)com>
To: Thom Brown <thombrown(at)gmail(dot)com>
Cc: "Oliveiros C, " <oliveiros(dot)cristina(at)marktest(dot)pt>, pgsql-novice(at)postgresql(dot)org
Subject: Re: Counting booleans for two columns
Date: 2009-11-20 16:18:29
Message-ID: d9e88eaf0911200818q65016dbao6d6c8f1d86916aac@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Fri, Nov 20, 2009 at 16:11, Thom Brown <thombrown(at)gmail(dot)com> wrote:

[...]
> SELECT sum(played::integer), sum(stats_exists::integer)
> FROM matches
> WHERE origin=1 AND NOT training AND match_date > '2009-08-01';

Thank you Thom and Oliveiros, this works perfect.

(I had to use Thom's case-code since the web hotel is still using
Postgres 7.4.6, so the boolean->integer cast did not work)

--
- Rikard

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Démi Zsolt 2009-11-20 20:44:31 pgsql cluster
Previous Message Thom Brown 2009-11-20 15:11:42 Re: Counting booleans for two columns