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.car_id) number_of_cars,
- z.id as zid,
- z.name as name,
- z.city as city
- from car_zone_logs czl
- join cars ca on ca.id = czl.car_id
- join car_classes cc on cc.id = ca.car_class_id
- join zones z on z.id = czl.zone_id
- Where czl.log_date + interval '8' hour >= @start
- and czl.zone_id not in (2,3,101,383,378,712,818,786)
- group by week,z.id ;
Advertisement
Add Comment
Please, Sign In to add comment