tbl_customer.id 是客户的id
tbl_order.customer_id
将选择在 tbl_order 中有 4 条或更多条记录的所有客户的查询
最佳答案
SELECT tbl_order.customer_id, COUNT(*)
FROM tbl_order
GROUP BY customer_id
HAVING COUNT(*) > 4
关于sql - MySQL查询以查找订单最多的客户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2448263/