ahmedrahil786

Test 2 - Daily Impact on MFTs - Special Pricing

Jul 22nd, 2019
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. set @start := '2019-7-1';
  2. select
  3. distinct c.member_id as mid,
  4. date(c.created_at + interval '8' hour) as date
  5. from charges c
  6. join members m on m.id = c.member_id
  7. where c.created_at + interval '8' hour >= @start
  8. and m.imaginary = 'normal'
  9. and c.kind = 'subscriptionFee'
  10. group by 1 ;
  11.  
  12. set @start1 := '2019-7-22';
  13. set @start2 := '2019-7-23';
  14. select
  15. distinct c.member_id as mid,
  16. date(c.created_at + interval '8' hour) as date
  17. from charges c
  18. join members m on m.id = c.member_id
  19. where c.created_at + interval '8' hour >= @start1
  20. and m.imaginary = 'normal'
  21. and c.kind = 'subscriptionFee'
  22. group by 1
Advertisement
Add Comment
Please, Sign In to add comment