I have a table of bids (like an eBay bids, for example):
bid_id | bid_from_user | bid_for_auction | bid_price
1 | 150 | 1 | 20
2 | 453 | 1 | 30
3 | 42 | 1 | 50
4 | 12 | 2 | 12
5 | 60 | 2 | 20
I need to select each bid_for_auction only once with its highest current bid, so my result should look like this:
bid_for_auction | bid_price
1 | 50
2 | 20
How would I go about doing this?
Use GROUP BY