Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select
- sum(TIMESTAMPDIFF(hour,CONVERT_TZ(r.start_at, '+00:00', '+8:00'),CONVERT_TZ(r.end_at, '+00:00', '+8:00'))) as ridelength
- from reservations r
- where CONVERT_TZ(r.start_at, '+00:00', '+8:00') >= '2019-1-1 00:00'
- and CONVERT_TZ(r.start_at, '+00:00', '+8:00') <= '2019-1-31 00:00'
- and r.state = 'completed'
Advertisement
Add Comment
Please, Sign In to add comment