I am using Oracle SQL, so outer joins have the nice (+) syntax. I should warn you that I am not allowed to redesign the database; I work for a large organization.
He
First of all, why can't you use proper OUTER JOIN
s?, you can use them in Oracle without having to do the implicit joins with the (+)
syntax. As for your problem, you can use IN
:
SELECT p.Name, a.Attribute
FROM People p
LEFT OUTER JOIN Attributes a
ON p.PersonID = a.PersonID AND a.Attribute IN ('Happy','Grouchy')