title: Oracle Why Exists Query Returns This Result
body: <p>I am confusing using exists to compare two data between two tables. I am expecting to get 0 rows from query but it returns some data. I don't know why. </p>
  
  <pre><code>select main_rule, child_rule from scoredef_detail s where s.main_rule = 515;
  1   515 516
  2   515 517
  
  select main_rule, child_rule from scoredef_detail_at s where s.main_rule = 515;
  1   515 516
  2   515 517
  </code></pre>
  
  <p>This query returns all of them above. I am trying to get differences. These columns are foreign keys of some other tables. Can it related with other table's records? </p>
  
  <pre><code>select main_rule, child_rule
    from scoredef_detail s
   where exists
   (select main_rule, child_rule
            from scoredef_detail_at sa
           where s.main_rule = sa.main_rule and (s.child_rule &lt;&gt; sa.child_rule));
  </code></pre>
  
  <p>Thanks in advance.</p>