tangledman — 2013-02-20T14:59:09-05:00 — #1
Is there a way to make this query more efficient?
Perhaps using group by ?
I am trying to find photos where no photo has been designate as main.
WHERE property.property_id NOT
FROM property, property_photo
WHERE property.property_id = property_photo.property_id
AND property_photo_main = '1'
davemaxwell — 2013-02-20T15:28:53-05:00 — #2
you can try this
FROM property p
LEFT JOIN property_photo pp ON p.property_id = pp.property_id
AND pp.property_photo_main = '1'
WHERE pp.property_id IS NULL
system — 2014-10-07T23:45:22-04:00 — #3
This topic is now closed. New replies are no longer allowed.