sigizmund.com
Building histograms using only MySQL
The query means a very simple thing: select count of matching rows, value of locations – grouped by locations field; rpad does all the magic – it basically says to add a certain number of ‘*’ on the right of empty string, number of ‘*’ is count(*). It’s been divided by 15 to fit the bar into the console screen. That’s it, chaps!
-
Categories
-
Calendar
February 2012 M T W T F S S « Jun 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 -
Meta





