Skip to content

Instantly share code, notes, and snippets.

@Lukse
Created May 29, 2014 06:07
Show Gist options
  • Save Lukse/8634d9544c67ee0d8c18 to your computer and use it in GitHub Desktop.
Save Lukse/8634d9544c67ee0d8c18 to your computer and use it in GitHub Desktop.
Count number of times value appears in particular column in MySQL
-- Duomenys:
-- zigmas
-- zigmas
-- petras
-- Rezultatai:
-- zigmas 2
-- petras 1
select name, count(*) as n FROM orders order by n GROUP BY name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment