Received: from jupiter.hub.org (jupiter.hub.org [64.49.215.5]) by postgresql.org (Postfix) with ESMTP id 0F95B475957 for ; Wed, 27 Feb 2002 01:02:21 -0500 (EST) Received: (from news@localhost) by jupiter.hub.org (8.11.6/8.11.6) id g1R61Xq41728 for pgsql-sql@postgresql.org; Wed, 27 Feb 2002 00:01:33 -0600 (CST) (envelope-from news) From: Edward Murray X-Newsgroups: comp.databases.postgresql.sql Subject: Re: Left Outer Join Question Date: Wed, 27 Feb 2002 16:59:11 +1100 Organization: Avenue Network Services Lines: 28 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: news@hub.org User-Agent: Pan/0.11.2 (Unix) X-Comment-To: "Christopher Kings-Lynne" To: pgsql-sql@postgresql.org X-Archive-Number: 200202/419 X-Sequence-Number: 6840 Chris, This has not fixed it. Thanks for your post. Regards Ed Murray >> select category.name, count(items.recordnum) from category left outer >> join items on (category.recordnum = items.catnum) where >> category.recordnum = section_subcats.catnum and >> section_subcats.sectionnum = 1 and items.clientnum = 333 group by >> category.name; > > Try using: > > count(coalesce(items.recordnum, 0)) > > instead of: > > count(items.recordnum) > > I can't guarantee that it will work - I haven't tried it myself. What's > probably happening is that count isn't counting NULLs? > > Chris > > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org