I have a table that looks something like this:
user_id item_id bid_amount
5 12 22
6 12 47
7 12 40
6 14 55
I am trying to get the highest bid for each item and user_id belonging to that bid. My current attempt:
select user_id, max(bid_amount) from bids group by item_id;
not so spectacular. I think its just user_id from the first line of int he group - is there one request that gets me the data I want?
source
share