User Profile
Collapse
-
PaxMagister replied to How can I limit a query to 2 of the same value in one col ordered by another col?in PostgreSQLThanks for the response. I guess I should have been a little more vague in my question, or a little more wordy. That was actually a simplified example. What if I wanted to get the top 10, so if there were more games for each person? I guess I can just nest it more, but I was looking for a more flexible solution. Sorry for not being as clear with my first question. Again thanks for responding. -
PaxMagister replied to How can I limit a query to 2 of the same value in one col ordered by another col?in PostgreSQLsorry
I want to return
name game score
steve chess 50
steve soccer 48
evan football 49
evan soccer 47Leave a comment:
-
PaxMagister started a topic How can I limit a query to 2 of the same value in one col ordered by another col?in PostgreSQLHow can I limit a query to 2 of the same value in one col ordered by another col?
Say I have a table:
name game score
Steve Chess 50
Steve Soccer 48
Steve Football 45
Evan Chess 46
Evan Soccer 47
Evan Football 49
I want to return each column for the two highest scores for each person. Can anyone tell me how to do this?
No activity results to display
Show More
Leave a comment: