Skip to content

Instantly share code, notes, and snippets.

@beck03076
Created February 17, 2016 12:28
Show Gist options
  • Save beck03076/2ed460e29b4ac5469c8c to your computer and use it in GitHub Desktop.
Save beck03076/2ed460e29b4ac5469c8c to your computer and use it in GitHub Desktop.
use sellerdata;
1. select count(*) from sellers;
2. select count(*) from seller_histories where signed_in_at is not null;
3. select count(s.user_id) from treasureProduct.products p INNER JOIN seller_histories s ON s.user_id = p.user_id where s.signed_in_at is not null group by p.user_id having count(p.id) > 0;
4. select count(*) from sellers where app_installed = 1;
5. select sum(a) from (select count(s.user_id) as a from treasureProduct.products p INNER JOIN seller_histories s ON s.user_id = p.user_id where s.signed_in_at is not null group by p.user_id having count(p.id) > 0) as b;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment