How do i write a query that will join two tables using an Or operator
For example:
select upc,ean,productName
from maintable m1 left join maintable2 m2
on m2.upc = m1.upc OR m2.ean = m1.ean
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Well, you can try using a UNION.
Does that work out for you? By default, the UNION operator will only return distinct rows, so do not worry about returning duplicates.