1、sql
select @rownum := @rownum + 1 as ‘row‘,a.service_goods_name,a.num from ( select t.service_goods_name,count(t.service_goods_id) as num,t.ser_addr_p,t.ser_addr_c,t.ser_addr_q from home_service_order t GROUP BY t.service_goods_id ) as a join ( select @rownum := 0 ) as tt order by a.num desc
2、效果