Skip to content

Instantly share code, notes, and snippets.

@leafo
Last active August 29, 2015 14:04
Show Gist options
  • Save leafo/4ea297e6c0016daba6c0 to your computer and use it in GitHub Desktop.
Save leafo/4ea297e6c0016daba6c0 to your computer and use it in GitHub Desktop.
select username, email, games_count, user_data.data from users
inner join user_data on user_data.user_id = users.id
where (
select count(*) from games
where
games.user_id = users.id and
paid_status > 1 and published and
not deleted and classification = 0 and purchases_count > 0
) > 1 order by games_count desc;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment