title: Why Oracle 10g doesn't complain about column ambiguity?
body: <p>I'm using Oracle 10g (XE 10.2.0.1.0), and find a behavior that I don't understand:</p>
  
  <pre class="lang-sql prettyprint-override"><code>select * 
  from employees manager
      join employees worker on MANAGER.EMPLOYEE_ID = WORKER.MANAGER_ID
      join departments on DEPARTMENTS.manager_id = 108
  where
      department_id = 100
  ;
  </code></pre>
  
  <p>The problem is I think Oracle should have complain about the ambiguity of <code>department_id</code> in the where clause, since it's a column in both the table <code>employees</code> and <code>departments</code>. The fact is in Oracle 10g, it doesn't, and the result shows that it interprets the <code>department_id</code> as the one in <code>departments</code>. However, if I comment out the second join statement (4th line above), Oracle does complain “ORA-00918: column ambiguously defined” as expected.</p>
  
  <p>So, can somebody help to explain how the ambiguity is defined in Oracle 10g? Or perhaps this is a bug in 10g?</p>
  
  <p>BTW: The tables are defined in the default HR schema bundled in the Oracle 10g.</p>
  
  <p>Update: Just found a related post:
  <a href="https://stackoverflow.com/questions/3264334/why-does-oracle-sql-mysteriously-resolve-ambiguity-in-one-joins-and-does-not-in-o">Why does Oracle SQL mysteriously resolve ambiguity in one joins and does not in others</a></p>