SELECT COUNT( 要统计次数的字段) FROM 表 GROUP BY 要统计字段 HAVING COUNT(要统计字段) > num
查询下单次数超过50次商品
SELECT goods_id, goods_name,COUNT(goods_id) FROM tp_order_goods GROUP BY goods_id HAVING COUNT(goods_id) > 50
时间: 2025-01-15 00:33:44
SELECT COUNT( 要统计次数的字段) FROM 表 GROUP BY 要统计字段 HAVING COUNT(要统计字段) > num
查询下单次数超过50次商品
SELECT goods_id, goods_name,COUNT(goods_id) FROM tp_order_goods GROUP BY goods_id HAVING COUNT(goods_id) > 50