Re: [GENERAL] showing also value '0' with aggregate count()

2001-09-27 Thread David Christian
aid "Try a left join" I should have said "left outer join"...the "OUTER" is commonly omitted. Thanks. :) Note that with UNION, you refer to columns by number, hence "order by 2". David On 9/27/01 11:35 AM, "Janning Vygen" <[EMAIL PROTECTED]&g

Re: [GENERAL] showing also value '0' with aggregate count()

2001-09-27 Thread David Christian
Try a left join: select name, count(client_id) AS cnt from clients left join sales on (client_id = id) group by name order by cnt; There's a great book for SQL called "The Practical SQL Handbook" which covers these types of problems well. Published by Addison Wesley, written by Bowman, Emerson,