Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select
- distinct r.member_id as mid,
- r.id as rid,
- date(CONVERT_TZ(r.start_at, '+00:00', '+8:00')) as date,
- r.state,
- IFNULL(c.comment,0) as couponname
- from reservations r
- left join members m
- on m.id = r.member_id
- left join coupons c
- on c.reservation_id = r.id
- where CONVERT_TZ(r.start_at, '+00:00', '+8:00') >= '2018-1-1 00:00'
- and m.imaginary = 'normal'
- and m.state = 'normal'
Advertisement
Add Comment
Please, Sign In to add comment