Select * from Auction_Listing as al LEFT JOIN Auction_Listing_Image as ali on al.a_listing_id = ali.a_listing_id Where al.auction_id = 54 AND al.active = 'y' and al.featured = 'y' and ali.sort_order = 1 Group by al.a_listing_id Order By RAND() LIMIT 4 Got error 28 from storage engine