title: Oracle join 2 tables on same column
body: <p>Can someone explain to me why the below query is returning null in the description field</p>
  
  <pre><code>Table A:
  
  OCD CCD 
  A   B
  C   D
  E   F
  
  Table B:
  CD   DESCRIP
  A    AL
  B    BL
  C    CL
  D    DL
  E    EL
  F    FL
  
  Result:
  OCD  DESCRIP CCD DESCRIP
  A    AL      B   BL
  C    CL      D   DL
  E    EL      F   FL
  </code></pre>
  
  <p>Incorrect Query:although this query runs correctly. It doesn't give description values.</p>
  
  <pre><code>select a.ocd,b.DESCRIP,a.CCD,b.DESCRIP
  from A a, B b
  where a.ocd=b.cd(+)
  and a.ccd=b.cd(+);
  </code></pre>
  
  <p>Correct query</p>
  
  <pre><code>select a.ocd,b.DESCRIP,a.CCD,b.DESCRIP
  from A a, B b1, B b2
  where a.ocd=b1.cd(+)
  and a.ccd=b2.cd(+);
  </code></pre>