Yesterday on irc someone asked: Hi, how do I get top 5 values from a column group by another column?? From further discussion, I learned that: total rows in table is 2 million. It'll have unique words of less than 1 million.. (approx ...

(disclaimer: all the data and examples in here are on Linux - the same data can be probably obtained on other systems too, it's just that I work on Linux and don't know other systems well). This question pops occasionally in ...