Skip to content

Instantly share code, notes, and snippets.

@joshsmith
Created October 6, 2010 08:27
Show Gist options
  • Save joshsmith/613014 to your computer and use it in GitHub Desktop.
Save joshsmith/613014 to your computer and use it in GitHub Desktop.
SELECT interests.iid, interests.title, COUNT(*)
FROM users_interests
JOIN interests ON interests.iid = users_interests.iid
WHERE users_interests.preference = 'dislike'
GROUP BY interests.iid
ORDER BY COUNT(*) DESC
LIMIT 10;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment