Guest User

Untitled

a guest
Oct 16th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. --waitlist
  2. select
  3. distinct
  4. us.name,
  5. us.email,
  6. c.code as pricing_plan,
  7. c.amount,
  8. u.created_at::date as entered_credit_card_at
  9. from user_events u
  10. join coupons c
  11. on c.id = json_extract_path_text(properties, 'coupon_id')
  12. join analytics.acquisition_credit_card_source_tracking a
  13. on a.user_id = u.user_id
  14. and a.subscription_id is null
  15. join users us
  16. on us.id = u.user_id
  17. where
  18. event_name in ('Payment Form Completed', 'Requested Access')
  19. and u.created_at >= getdate() - '30 days'::interval
  20. order by 5 desc
Add Comment
Please, Sign In to add comment