title: Get row with max(column)
body: <p>Whenever I use the <code>max</code> function I somehow lose all the connection to my other values, so that the row that is printed later doesn't correlate with the column that I ran max on anymore.</p>
  
  <p>So my table is:</p>
  
  <pre><code>user col1 col2 col3
  1    1    2    3
  1    3    4    5
  2    2    3    1
  3    1    1    3
  3    2    4    6
  4    5    1    5
  </code></pre>
  
  <p>So if I run</p>
  
  <pre><code>select user, col1, col2, max(col3) as col3
  from table
  group by user
  order by user;
  </code></pre>
  
  <p>I would get</p>
  
  <pre><code>user col1 col2 col3
  1    1    2    5
  2    2    3    1
  3    1    1    6
  4    5    1    5
  </code></pre>
  
  <p>So the max value of col3 is correct, but it doesn't get the correct row of that value.</p>
  
  <p>What I want is to get the max value of a column and return that row for each user. If there are multiple max values that it should return all users, even if it has same user id.</p>