Re: Count equals 0 - Mailing list pgsql-sql

From jasiek@klaster.net
Subject Re: Count equals 0
Date
Msg-id 20030318113722.GA16600@serwer.skawsoft.com.pl
Whole thread Raw
In response to Count equals 0  (Rudi Starcevic <rudi@oasis.net.au>)
List pgsql-sql
On Tue, Mar 18, 2003 at 04:29:13PM +1000, Rudi Starcevic wrote:
<cut>
> What I would like to see is something like:
> 
> site a : 0
> site b : 3
> site c : 6
<cut>
Maybe something like this:
select um.site_name,count(*)-sum(case when usm.cus_id is null then 1 else 0 end) as total
from user_main umleft_join user_sys_messages usm using (cus_id)group by um.site_nameorder by um.site_name;


pgsql-sql by date:

Previous
From: Christoph Haller
Date:
Subject: Re: Min values?
Next
From: Christoph Haller
Date:
Subject: Re: the best way to get some records not in another table