Code:
SELECT listing.rentaladtitle
, images.tnName
, listing.listingId
, listing.rentpermonth
, listing.bedrooms
, listing.bathrooms
, listing.city
, listing.address
, listing.latitude
, listing.longitude
, listing.phoneAd
, listing.nameContactAd
, LEFT(listing.rentaladdescription, 10)
AS rentaladdescription
FROM listing
INNER
JOIN listingparameter
ON listingparameter.listingFk = listing.listingId
AND listingparameter.offline = 1
LEFT OUTER
JOIN ( SELECT listingFk
, MIN(imageOrder) AS min_order
FROM images
GROUP
BY listingFk ) AS m
ON m.listingFk = listing.listingId
LEFT OUTER
JOIN images
ON images.listingFk = listing.listingId
AND images.imageOrder = m.min_order
WHERE nameContactAd = #pmLowerCaseWithoutDashes#'
If I have two of the exact same "listing.address" how can I just return one unique property?
Example:
listing.address = 123 Any Street
listing.address = 123 Any Street