title: Workaround for outer join with an IN operator in Oracle
body: <p>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.</p>
  
  <p>Here are some example tables:</p>
  
  <pre><code>People
  PersonID   Name
  1          Elmo
  2          Oscar
  3          Chris
  
  Attribute
  PersonID   Attribute
  1          Happy
  1          Muppet
  1          Popular
  2          Grouchy
  2          Muppet
  2          Popular
  3          Programmer
  </code></pre>
  
  <p>I want a list of people and I want to know whether we have knowledge of them being happy or grouchy. The following is the output I want:</p>
  
  <pre><code>Name       Mood
  Elmo       Happy
  Oscar      Grouchy
  Chris
  </code></pre>
  
  <p>So here is the query I thought I would use:</p>
  
  <pre><code>SELECT p.Name, a.Attribute
  FROM People p, Attributes a
  WHERE p.PersonID = a.PersonID (+)
  AND ( a.Attribute (+) = 'Happy'
     OR a.Attribute (+) = 'Grouchy' )
  </code></pre>
  
  <p>(Perhaps I would have to put "OR a.Attribute IS NULL" or something.) </p>
  
  <p>But in fact I'm not allowed to use OR inside an outer join at all! What should I actually do instead?</p>