Skip to content

Instantly share code, notes, and snippets.

@alpha1
Created December 12, 2014 03:47
Show Gist options
  • Save alpha1/7dd932a91707295d9e3e to your computer and use it in GitHub Desktop.
Save alpha1/7dd932a91707295d9e3e to your computer and use it in GitHub Desktop.
MYSQL: Get Counts for each unique value in a single column in a single tablet
SELECT `Column1`,`Column2`,COUNT(*) as count FROM `TABLE` GROUP BY `COLUMN1` ORDER BY `X` ASC, `count` DESC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment