title: SQL: Select all distinct and pick the row that has the max value in another column
body: <pre><code>| nid | vid | max_score |
  |-----+-----+-----------|
  |  1  |  1  |     1     |
  |-----+-----+-----------|
  |  1  |  2  |     1     |
  |-----+-----+-----------|
  |  2  |  1  |     1     |
  |-----+-----+-----------|
  |  2  |  2  |     2     |
  -------------------------
  </code></pre>
  
  <p>I would like to select only the distinct nid, but also only take the row where the vid is the highest.</p>
  
  <p>So the result here would give me</p>
  
  <p>1, 2, 1</p>
  
  <p>2, 2, 2</p>