Jump to content

limit records from join


Prellyan

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.