pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Edward Murray <mail@avenuedesign.net>
To: pgsql-sql@postgresql.org
Subject: Re: Left Outer Join Question
Date: Wed, 27 Feb 2002 16:59:11 +1100
Message-ID: <a5hsn1$186s$1@jupiter.hub.org> (raw)
References: <GNELIHDDFBOCMGBFGEFOCEJCCBAA.chriskl@familyhealth.com.au>

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



view thread (8+ messages)  latest in thread

Message-ID: <a5hsn1$186s$1@jupiter.hub.org>
Permalink:  ../a5hsn1$186s$1@jupiter.hub.org/
Also on:    postgresql.org/message-id/a5hsn1$186s$1@jupiter.hub.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mail@avenuedesign.net
  Subject: Re: Left Outer Join Question
  In-Reply-To: <a5hsn1$186s$1@jupiter.hub.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox