title: SQL select on parent child relation with multiple join conditions
body: <p>I have a parent/child relation with the following child table:</p>
  
  <pre><code>
  CHILD_ID    PARENT_ID    CHILD_VALUE
  ------------------------------
  1           1            x
  2           1            y
  3           2            y
  </code></pre>
  
  <p>Now I want to select all existing distinct parents where the CHILD_VALUE is:</p>
  
  <ul>
  <li>child has value = x (there will be only 1 or none)</li>
  <li>if no child with value x exists - NULL</li>
  </ul>
  
  <p>In other words show all parents with "matching" child or NULL if no child "matching" the value exists.</p>
  
  <p>So the result shall look like this:</p>
  
  <pre><code>
  PARENT_ID    CHILD_ID    CHILD_VALUE
  ------------------------------
  1            1           x
  2            NULL        NULL
  </code></pre>
  
  <p>Question would be how I can narrow down the join in this case.</p>