title: Compare 2 fields in different rows of the same table
body: <p>I want to return results from a join where the birth_date of two+ records are the same, but the person_id's are not equal. I am using Oracle. So if I got 4 results where rows 1 &amp; 2 have the same birth_date and different person_id, those rows would be returned. Where rows 3 &amp; 4 have the same birth_date and same person_id, those rows would not be returned. I get results, but I want to filter our results where the birth_date of rows are equal, but the person_id is &lt;>. </p>
  
  <pre><code>  select t3.field1, t6.field2, t6.field3, t3.field4, t3.field5 
  from table1 t1
      inner join table2 t2 on t1.@matching = t2.@matching
      inner join table3 t3 on t3.@matching = t1.@matching
      inner join table4 t4 on t4.@matching = t1.@matching
      inner join table5 t5 on t5.@matching = t4.@matching
      inner join table6 t6 on t6.@matching = t3.@matching
        where t1.@requirement = 'xxx' 
        and t2.@requirement = 'xxx' 
        and t2.@requirement is null 
        and t4.@requirement = 'xxx'
        and t5.@requirement = 'xxx' 
        and t1.@requirement ='xxx' 
        and t5.@requirement is null 
      order by t1.@field ASC;
  </code></pre>