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!

Posted in: Uncategorized

Tags: ,



This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

addLeave a comment