I have the following dataset shown here
http://sqlfiddle.com/#!17/f9280/1
I want to query the data in a way that I get for each key and category the average rank
for instance,
Any help or a good reference on how to do that on Postgres will be highly appreciated :)