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 Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/160239-limit-records-from-join/#findComment-850485 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.