Skip to content

Instantly share code, notes, and snippets.

@Ademking
Last active July 20, 2018 03:13
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 Ademking/9541f9b7b57cddef8115a3745e4a393d to your computer and use it in GitHub Desktop.
Save Ademking/9541f9b7b57cddef8115a3745e4a393d to your computer and use it in GitHub Desktop.
πŸ˜ƒ SQL : get top100 score in table (useful)
SELECT
  SUM(column) AS Top_Scores, user_id, COUNT(rating) as number_of_times
FROM Table
GROUP BY user_id
ORDER BY SUM(column) DESC LIMIT 100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment