ahmedrahil786

Finding Cancellation Rates

May 16th, 2019
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. select
  2. distinct r.member_id as mid,
  3. r.id as rid,
  4. date(CONVERT_TZ(r.start_at, '+00:00', '+8:00')) as date,
  5. r.state,
  6. IFNULL(c.comment,0) as couponname
  7.  
  8. from reservations r
  9. left join members m
  10. on m.id = r.member_id
  11.  
  12. left join coupons c
  13. on c.reservation_id = r.id
  14. where CONVERT_TZ(r.start_at, '+00:00', '+8:00') >= '2018-1-1 00:00'
  15. and m.imaginary = 'normal'
  16. and m.state = 'normal'
Advertisement
Add Comment
Please, Sign In to add comment