Re: count( only if true)

From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: count( only if true)
Date: 2005-10-12 19:20:24
Message-ID: 20051012192024.GA6967@webserv.wug-glas.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

am 12.10.2005, um 20:42:02 +0200 mailte peter pilsl folgendes:
>
> the count-aggreate counts every expression that does not evaluate to null.
>
> I would like to have a count that counts all values that are true.
>
> Do I really need to make a count( case when expression then 't' else null)
> to implement this?

count(*) from foo where bar = '...';

Regards, Andreas
--
Andreas Kretschmer (Kontakt: siehe Header)
Heynitz: 035242/47212, D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
=== Schollglas Unternehmensgruppe ===

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Nicolao Renè 2005-10-12 19:27:50 Help with asynchronous queries
Previous Message Martín Marqués 2005-10-12 19:19:09 Re: count( only if true)