The following MySQL query is used to fetch auctions from a database and display the latest bid on the auction. However, if there are no bids on an auction, it will not return any results. How can I change the query so that rows are returned even if there are no bids (i.e. rows in the bids table matching this auction).
dt_domains.id AS domain_id,
dt_auctions.id AS auctionid,
INNER JOIN (
SELECT dt_bids.auction_id, max(dt_bids.id) AS lastdate
GROUP BY auction_id
) AS o ON dt_bids.auction_id = o.auction_id
AND dt_bids.id = o.lastdate
LEFT JOIN dt_auctions ON dt_auctions.id = dt_bids.auction_id
LEFT JOIN dt_domains ON dt_domains.id = dt_auctions.domain_id
WHERE dt_domains.owner = '1'
GROUP BY dt_auctions.id