Skip to content

Instantly share code, notes, and snippets.

@EstebanFuentealba
Last active August 29, 2015 14:06
Show Gist options
  • Save EstebanFuentealba/b75d19c21a4a37e19b47 to your computer and use it in GitHub Desktop.
Save EstebanFuentealba/b75d19c21a4a37e19b47 to your computer and use it in GitHub Desktop.
SELECT SUBSTRING_INDEX(email,'@',-1) , count(*) as 'total'
FROM votantes
GROUP BY SUBSTRING_INDEX(email,'@',-1)
ORDER BY total DESC
SELECT count(*) as 'total', ip
FROM votantes
GROUP BY ip
ORDER BY total DESC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment