Search Postgresql Archives

Re: Question about a query with two count fields

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 9/11/07, Jeff Lanzarotta <delux256-postgresql@xxxxxxxxx> 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

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux