Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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

pgsql-novice by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group