I am attempting to join 3 tables
users. I need several key pieces of information from each table based off the
bids table. In the end I want a summary overview of the auctions. To see the latest bid for each auction and the user that placed it.
I am used to doing simple SQL queries and I am not sure what I need to do in order to accomplish this. Not looking for a solution (although I would take it with an explanation) but learning experience.
Query So Far
So far this is what I have started with, any guidance on what to do from here is greatly appreciated.
SELECT MAX(bids.id) AS 'Bid ID', bids.auction_id AS 'Auction ID', auctions.title AS 'Auction Title', MAX(bids.bid_amount) AS 'Bid Amount' FROM boardman_bidding.bids INNER JOIN boardman_bidding.auctions ON bids.auction_id = auctions.id INNER JOIN boardman_bidding.users ON bids.user_id = users.id WHERE bids.auction_id > 1065 AND auctions.city_id = '45621' GROUP BY bids.auction_id ORDER BY bids.auction_id DESC;
I am hoping for the following: