title: SQL 2 left outer joins on same table
body: <p>I'm doing 2 joins on the same table and I want the following results:</p>
  
  <pre><code>chnl_ptnr_key type1_ky type2_ky
  ------------- -------- --------
  1             1        null
  1             2        null
  1             null     3
  1             null     4
  </code></pre>
  
  <p>But instead I'm getting</p>
  
  <pre><code>chnl_ptnr_key type1_ky type2_ky
  ------------- -------- --------
  1             1        3
  1             2        3
  1             2        3
  1             2        4
  </code></pre>
  
  <p>My query is:</p>
  
  <pre><code>SELECT cp.chnl_ptnr_ky, cpmap1.ky as type1_ky, cpmap2.ky as type2_ky
  FROM chnl_ptnr cp
  LEFT OUTER JOIN chnl_ptnr_oos_map cpmap1 on (cp.chnl_ptnr_ky = cpmap1.chnl_ptnr_ky and cpmap1.typ = 'TYPE1')
  LEFT OUTER JOIN chnl_ptnr_oos_map cpmap2 on (cp.chnl_ptnr_ky = cpmap2.chnl_ptnr_ky and cpmap2.typ = 'TYPE2')
  WHERE cp.chnl_ptnr_ky = '1111'
  </code></pre>
  
  <p>Can someone help me to change this query so I get nulls in <code>type1_ky</code> and <code>type2_ky</code> where the row is being returned from the other join?
  I need this format because I'm attempting to use it for an iBATIS map.</p>
  
  <p>Many thanks</p>