-- 收费单价明细 select amount_flag , count(order_no) as order_num from ( select t.order_no, round(a.amount / 100 /(round(TIMESTAMPDIFF(second, start_time, end_time)/ 3600))) as amount_flag from luo_parking_chargerecord t inner join luo_parking_chargerecord_subject a on t.order_no = a.order_no where t.start_time is not null) t1 where t1.amount_flag between 2 and 5 group by 1 order by 1