I'm trying to build a specific sql query but i have no idea how to implement what i want.
My database looks like this:
Col1 Col2
"a" 5
"b" 7
"a" 8
"a" 7
"b" 5
"b" 7
"c" 3
"a" 4
"b" 3
"b" 4
"c" 1
And I want a query that returns something like this:
"a" 8
"a" 7
"b" 7
"b" 7
In words: the 2 highest values of the first x strings.
And only putting a limit after sorting doesn't work, because the order by refers to the whole result and not only to one "group" of the result. I hope you understand what i'm up to.