私は2つのテーブルを持っています:
1.customer (contains customers)
2.customer_order (contains orders)
これを知りたい:
no. of customers with 0 orders
no. of customers with 1 order
no. of customers with 2 orders
etc
私はこれを持っています:
SELECT COUNT(co.id)
FROM customer c
LEFT JOIN customer_order co
ON c.id=co.id_customer
GROUP BY ??? ;