Re: Left Outer Join Question

Поиск
Список
Период
Сортировка
От Edward Murray
Тема Re: Left Outer Join Question
Дата
Msg-id a5hsn1$186s$1@jupiter.hub.org
обсуждение исходный текст
Ответ на Re: Left Outer Join Question  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
Список pgsql-sql
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


В списке pgsql-sql по дате отправления:

Предыдущее
От: "grep"
Дата:
Сообщение: Bad design or SQL statment quandary
Следующее
От: "Christopher Kings-Lynne"
Дата:
Сообщение: Re: Left Outer Join Question