RE: Not finding customers without invoices

2005-11-02 Thread Paul Rhodes
Hi Mike, You'll need to use a LEFT JOIN instead of an INNER JOIN. LEFT JOIN returns mismatches between tables. Try something like: SELECT customers.company, count(invoices.id) as invcount FROM customers LEFT JOIN invoices ON customers.id= invoices.customer_id GROUP BY customers.id ORDER BY custo

RE: How can I do?

2005-10-31 Thread Paul Rhodes
Hi, One possible way would be to the UNION statement - I think this would be your best action, providing the data is consistent across all three tables. See: http://dev.mysql.com/doc/refman/5.0/en/union.html Hope this helps, Paul -Original Message- From: Priscilla Labanca [mailto:[EMA