Prellyan Posted May 30, 2009 Share Posted May 30, 2009 Hey there, This is my sql... SELECT * ,LEFT(description ,30) As description FROM auctionpropertyaddressdata LEFT JOIN auctionpropertyimages ON auctionpropertyaddressdata.auctionpropertyid = auctionpropertyimages.auctionpropertyid ORDER BY propertyprice ASC how can i limit the number of returned records in the auctionpropertyimages table to ORDER BY RAND() LIMIT 1 so i get all records from auctionpropertyaddressdata and only 1 record from auctionpropertimages table for each auctionpropertyid Cheers Link to comment https://forums.phpfreaks.com/topic/160239-limit-records-from-join/ Share on other sites More sharing options...
fenway Posted June 6, 2009 Share Posted June 6, 2009 Do it the other way... group by on your images table first, then join it back. Link to comment https://forums.phpfreaks.com/topic/160239-limit-records-from-join/#findComment-850485 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.