SELECT users.id, COUNT(?) FROM orders
INNER JOIN users ON (orders.user_id = users.id)
WHERE ??
How can i output:
UserID: 123 has made 22 orders
UserID: 124 has made 2 orders
and so on?
I would like to only grab the users that has one or more orders, and exclude those with 0 orders.
1 Answer