Skip to content

Instantly share code, notes, and snippets.

@brantfaircloth
Last active September 4, 2015 13:44
Show Gist options
  • Save brantfaircloth/331137 to your computer and use it in GitHub Desktop.
Save brantfaircloth/331137 to your computer and use it in GitHub Desktop.
SQL Histograms
SELECT val, COUNT(val) AS frequency,
repeat('.',COUNT(val)) AS histogram
FROM data GROUP BY val ORDER BY val;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment