charge_price.txt 413 B

1234567891011121314151617181920212223
  1. -- 收费单价明细
  2. select
  3. amount_flag ,
  4. count(order_no) as order_num
  5. from
  6. (
  7. select
  8. t.order_no,
  9. round(a.amount / 100 /(round(TIMESTAMPDIFF(second, start_time, end_time)/ 3600))) as amount_flag
  10. from
  11. luo_parking_chargerecord t
  12. inner join
  13. luo_parking_chargerecord_subject a
  14. on
  15. t.order_no = a.order_no
  16. where
  17. t.start_time is not null) t1
  18. where
  19. t1.amount_flag between 2 and 5
  20. group by
  21. 1
  22. order by
  23. 1