MySQL Forums
Forum List  »  Newbie

What's wrong with this? (Left Join)
Posted by: Shawn B
Date: March 25, 2005 08:11AM

What wrong with this? I'm trying to select records where the email address equals the email address?


SELECT ad.upload
, ad.value AS 'Address'
, cy.value AS 'City'
, st.value AS 'State'
, ap.value AS 'Asking Price'
, ty.value AS 'Type'
, ph.value AS 'Contact Phone'
, bdrms.value AS 'Bedrooms'
, bath.value AS 'Bathrooms'
, sqf.value AS 'Square Footage'
,email.value AS 'Email Address'
FROM ezu_uploadinfos AS ad
LEFT JOIN ezu_uploadinfos AS cy ON (ad.upload=cy.upload) AND (cy.name='City')
LEFT JOIN ezu_uploadinfos AS st ON (ad.upload=st.upload) AND (st.name='State')
LEFT JOIN ezu_uploadinfos AS ap ON (ad.upload=ap.upload) AND (ap.name='Asking Price')
LEFT JOIN ezu_uploadinfos AS ty ON (ad.upload=ty.upload) AND (ty.name='Type')
LEFT JOIN ezu_uploadinfos AS ph ON (ad.upload=ph.upload) AND (ph.name='Contact Phone')
LEFT JOIN ezu_uploadinfos AS bdrms ON (ad.upload=bdrms.upload) AND (bdrms.name='Bedrooms')
LEFT JOIN ezu_uploadinfos AS bath ON (ad.upload=bath.upload) AND (bath.name='Bedrooms')
LEFT JOIN ezu_uploadinfos AS sqf ON (ad.upload=sqf.upload) AND (sqf.name='Square Footage')
LEFT JOIN ezu_uploadinfos AS email ON (ad.upload=email.upload) AND (email.name='Email Address')
WHERE (ad.name='Address')";

Options: ReplyQuote


Subject
Written By
Posted
What's wrong with this? (Left Join)
March 25, 2005 08:11AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.