This is just a pseudo code example based on my Oracle experience but I 
think you have an extra 'table' in there.

I think you are working too hard, this idea came to me when I was trying 
to work you sub select out.

SELECT
  p.property_id,
  FIRST(pp.photo_filename)

FROM
  properties p LEFT JOIN
  property_photos pp ON (pp.mls_number = p.mls_number)

GROUP BY
  p.property_id

P.S.  I left out the substring() function for brevity and general 
sympathy for such a convoluted relationship key.

P.P.S I am assuming your database management system (mysql) supports the 
FIRST() SQL aggregate function.  It is not one I have used before and I 
do not know how universal it is.  If it does not work 
min(pp.photo_filename) would probably work but this could be a different 
image then you want when more then one is available.




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:305857
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to