Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

list of users with the most druplicoins #1

Open
greggles opened this issue Apr 10, 2012 · 0 comments
Open

list of users with the most druplicoins #1

greggles opened this issue Apr 10, 2012 · 0 comments

Comments

@greggles
Copy link
Owner

It would be great to show:

  • users with the most druplicoins in play
  • users with the most druplicoins in hand
  • users with the most druplicoins in play + in hand

Here are all three queries:
select sum(druplicoins), u.uid, u.name from (select sum(amount) as druplicoins, uid from pmb_bets p inner join field_data_field_question_status fqs on p.nid = fqs.entity_id where fqs.field_question_status_value = 1 group by uid union select sum(points) as druplicoins, uid from userpoints group by uid) tehsub inner join users u on tehsub.uid = u.uid group by u.uid, u.name ORDER BY SUM(druplicoins) DESC;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant