SELECT customers.company, count(invoices.id) as invcount FROM customers, invoices WHERE customers.id= invoices.customer_id GROUP BY customers.id ORDER BY customers.creation desc
Thanks! -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]