由于一个以上的客户可以拥有相同的最大数量,因此您应该执行以下 *** 作
SELECt customer_id, COUNT(customer_id) AS customerrowcount FROM rental GROUP BY customer_id HAVINg COUNT(customer_id) = (SELECt COUNT(customer_id) FROM rental GROUP BY customer_id ORDER BY COUNT(customer_id) DESC LIMIT 1)
但是,如果您可以选择任意客户,则应该使用rsbarro的答案
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)