I want to start by telling that this is a really specific question. It's also highly related to this thread. There they use:
SELECT foo,bar FROM my_table GROUP BY foo,bar
But what differentiates this question against the linked one is when a dupplicate is found; an arbitrary row of the duplicates is returned. I need to get the row with the highest value of a third column. For example:
a b 20
a b 10
a a 2
b b 10
b b 29
c c 2
c c 4
c c 9
Desired output:
a b 20
b b 29
c c 9