ahmedrahil786

One way Zones in Weekends - Rahil for Bala

Aug 26th, 2019
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. set @start := '2019-8-1';
  2. select distinct r.start_zone_id, z.name as name ,z.region as region
  3. from reservations r join zones z on z.id = r.start_zone_id
  4. where r.return_at + interval 8 hour >= @start
  5. and r.way in ('oneway','onewayRetrun')
  6. and DAYNAME(convert_tz(r.start_at, '+00:00', '+8:00')) in ('Saturday', 'Sunday')
Advertisement
Add Comment
Please, Sign In to add comment