Re: Not finding customers without invoices

2005-11-02 Thread Brian Dunning
Thanks very much to all of you! Obviously I need to learn more about joins. Appreciate the kick in the pants. :) -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: Not finding customers without invoices

2005-11-02 Thread Michael Stassen
[EMAIL PROTECTED] wrote: Brian Dunning <[EMAIL PROTECTED]> wrote on 02/11/2005 16:22:29: I'm trying to find a list of customers including a count of all their invoices, but it's not including customers who have no invoices - and it should. What's broken? SELECT customers.company, count(invo

RE: Not finding customers without invoices

2005-11-02 Thread Paul Rhodes
ER BY customers.creation desc Hope this helps, Paul -Original Message- From: Brian Dunning [mailto:[EMAIL PROTECTED] Sent: 02 November 2005 16:22 To: mysql@lists.mysql.com Subject: Not finding customers without invoices I'm trying to find a list of customers including a count of

Re: Not finding customers without invoices

2005-11-02 Thread Ian Sales (DBA)
Brian Dunning wrote: I'm trying to find a list of customers including a count of all their invoices, but it's not including customers who have no invoices - and it should. What's broken? SELECT customers.company, count(invoices.id) as invcount FROM customers, invoices WHERE customers.id= in

Re: Not finding customers without invoices

2005-11-02 Thread Alec . Cawley
Brian Dunning <[EMAIL PROTECTED]> wrote on 02/11/2005 16:22:29: > I'm trying to find a list of customers including a count of all their > invoices, but it's not including customers who have no invoices - and > it should. What's broken? > > SELECT customers.company, count(invoices.id) as invcoun

Not finding customers without invoices

2005-11-02 Thread Brian Dunning
I'm trying to find a list of customers including a count of all their invoices, but it's not including customers who have no invoices - and it should. What's broken? SELECT customers.company, count(invoices.id) as invcount FROM customers, invoices WHERE customers.id= invoices.customer_id GROU