Skip to content

Instantly share code, notes, and snippets.

@lbadura
Created March 9, 2015 13:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lbadura/a7403462a50e00ed2ba4 to your computer and use it in GitHub Desktop.
Save lbadura/a7403462a50e00ed2ba4 to your computer and use it in GitHub Desktop.
WAPU/WAPA
select count(distinct ua.account_id) as wapa from user_activities ua
join paylogs p on p.account_id = ua.account_id
where ua.date >= '2015-03-02' and ua.date <= '2015-03-08'
and p.date >= '2015-03-02' and p.date <= '2015-03-08'
and p.status in('paying', 'expried');
select count(distinct ua.user_id) as wapu from user_activities ua
join paylogs p on p.account_id = ua.account_id
where ua.date >= '2015-03-02' and ua.date <= '2015-03-08'
and p.date >= '2015-03-02' and p.date <= '2015-03-08'
and p.status in('paying', 'expried');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment