views:

206

answers:

1

I have made a simple auction section on my site, and I would like to display the user's current high bid on their My Bids page. I have a table that holds each unique bid that has the unique auction_id. My current query is as follows, but this only orders the groups instead of ordering what is inside the groups as well. I only want the highest value in each group.

SELECT * FROM tblAuctionBids WHERE username = '$username' GROUP BY auction_id ORDER BY id DESC LIMIT 10
+1  A: 
SELECT MAX(bid), * FROM tblAuctionBids WHERE username='$username' GROUP BY auction_id ORDER BY id DESC LIMIT 10
ceejayoz
Ah, yes MAX is what I was looking for. Thanks!
James Simpson