title: MAX and GROUP BY - SQL
body: <p>I'm working on Oracle SQL and HR database, I'm trying to select maximum salary in department like this:</p>
  
  <pre><code>SELECT MAX(salary), department_id
  FROM employees GROUP BY department_id;
  </code></pre>
  
  <p>It works fine, but I want to know >who&lt; is earning the most, so I simply change query this way:</p>
  
  <pre><code>SELECT first_name, last_name, MAX(salary), department_id
  FROM employees GROUP BY department_id;
  </code></pre>
  
  <p>And it's wrong. Could you help me, please?</p>