Re: Question about a query with two count fields - Mailing list pgsql-general

From Rodrigo De León
Subject Re: Question about a query with two count fields
Date
Msg-id a55915760709110902g4fc7fa16g8c3227a4bb5a94ed@mail.gmail.com
Whole thread Raw
In response to Question about a query with two count fields  (Jeff Lanzarotta <delux256-postgresql@yahoo.com>)
Responses Re: Question about a query with two count fields  ("Rodrigo De León" <rdeleonp@gmail.com>)
List pgsql-general
On 9/11/07, Jeff Lanzarotta <delux256-postgresql@yahoo.com> wrote:
> I appreciate the help...

SELECT   TO_CHAR(ts, 'MM/DD/YYYY') AS "day", str, proc
       , SUM(CASE
               WHEN z <> 0
                 THEN 1
               ELSE 0
             END) AS good, 0 AS ajaaaaaaaaaaaaaa
       , SUM(CASE
               WHEN z = 0
                 THEN 1
               ELSE 0
             END) AS bad
    FROM foobar
   WHERE str <> 99999
GROUP BY str, DAY, proc
ORDER BY str

pgsql-general by date:

Previous
From: "George Pavlov"
Date:
Subject: Re: Question about a query with two count fields
Next
From: "Dmitry Koterov"
Date:
Subject: Sthange things happen: SkyTools pgbouncer is NOT a balancer