title: Unexpected result of a SQL query
body: <p>Can anyone explain why  this query:</p>
  
  <pre><code>SELECT employee_id, last_name, salary 
  FROM   employees
  WHERE  department_id IN (SELECT department_id
                       FROM   employees
                       WHERE  last_name LIKE '%u%'
                       )
  AND  salary &gt; (SELECT AVG(salary)  
             FROM employees);
  </code></pre>
  
  <p>returns way less rows than this nested one: </p>
  
  <pre><code>SELECT employee_id, last_name, salary 
  FROM   employees
  WHERE  department_id IN (SELECT department_id
                       FROM   employees
                       WHERE  last_name LIKE '%u%'
                       AND  salary &gt; (SELECT AVG(salary)  
                                      FROM employees);
                       )
  </code></pre>