Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select
- WEEKOFYEAR(czl.log_date + interval '8' hour) as Week,
- count(distinct czl.id)/7 as cars
- from car_zone_logs czl
- where czl.log_date + interval '8' hour >= @start
- and czl.car_state = 'normal'
- and czl.zone_state = 'normal'
- group by 1 ;
- select
- MONTH(czl.log_date + interval '8' hour) as Week,
- count(distinct czl.id)/30 as cars
- from car_zone_logs czl
- where czl.log_date + interval '8' hour >= @start
- and czl.car_state = 'normal'
- and czl.zone_state = 'normal'
- group by 1 ;
Advertisement
Add Comment
Please, Sign In to add comment