MySQL Forums
Forum List  »  Newbie

Conditions using left join
Posted by: Shaun Day
Date: March 30, 2005 02:45AM

I'm having trouble constructing this left join query.
all rows in tProducts where prodcode = SF, and any matching entry in pictures, but also showing null where there is no entry in pictures, however what I find is that it returns ALL rows from tProducts, and disregards both conditions.
Am I doing it wrong?

SELECT prodCode, prodName
FROM tProducts LEFT JOIN pictures
ON productID = relProdId
AND prodCode = 'SF2'

Options: ReplyQuote


Subject
Written By
Posted
Conditions using left join
March 30, 2005 02:45AM
March 30, 2005 07:06AM


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.