title: sql min function and other column
body: <p>i want to know if it is possible to add another column to a select statement that contain an aggregate function like min, max ...</p>
  
  <p>example :</p>
  
  <pre><code>SELECT user_id, MAX(salary) FROM users;
  </code></pre>
  
  <p>is this statement correct in the sql standard(in mysql its work );
  its work in mysql, but i think i read somewhere that if i put an aggregate function in the select clause, i can't put anything but an aggregate function or if there is a group by, the grouped column can be in the select clause (in mysql) </p>
  
  <hr>
  
  <p><strong>EDIT</strong> :</p>
  
  <pre><code>User(user_id, name, last_name, salary)
  </code></pre>
  
  <p>i want to select the <code>user_id, name, (maximum salary column)</code> from the <code>User</code> table; is it possible to do it without sub query?</p>
  
  <p>User Table</p>
  
  <pre><code>User_id, Name, Salary
  
  | 1 | user1 | last1 | 500  |   |
  |---|-------|-------|------|---|
  | 2 | user2 | last2 | 1000 |   |
  | 3 | user3 | last3 | 750  |   |
  |   |       |       |      |   |
  </code></pre>
  
  <p>the output must be the <code>user_id, username, lastname, and salary of the user who have the max salary</code>, so here the ouput must be :</p>
  
  <pre><code> 2 user2 last2 1000
  </code></pre>
  
  <hr>