ahmedrahil786

Utilization Tracker - Cars Info - To test pricing Increase

Apr 11th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. select
  2.  
  3. date(cz.created_at + interval '8' hour) as day,
  4. c.id as carid,
  5. cc.car_name as carname,
  6. z.region as Region
  7.  
  8. from cars as c
  9.  
  10. join car_classes as cc
  11. on c.car_class_id = cc.id
  12.  
  13. join zones as z
  14. on z.id = c.zone_id
  15.  
  16. join car_zone_logs as cz
  17. on c.id = cz.car_id
  18.  
  19. where cz.car_state = 'Normal'
  20. and z.state = 'normal'
  21.  
  22. group by c.id
Add Comment
Please, Sign In to add comment