title: Order entire groups of results by highest value in each group
body: <p>For example, let's say that I have a table in PostgreSQL (higher than 9.0), filled with data:</p>
  
  <pre><code>row_id    percent    isrc
  1         100        123iee43
  2         100        1234wr32
  3         98         123iee43
  4         99         1234wr32
  5         95         12313be3
  6         99         12313be3
  7         96         12313be3
  </code></pre>
  
  <p>I would like my result to contain ALL of the above rows grouped by column <code>isrc</code> and then entire groups ordered by <code>percent</code>, descending. So this is what the result should look like:</p>
  
  <pre><code>row_id    percent    isrc
  1         100        123iee43
  3         98         123iee43
  2         100        1234wr32
  4         99         1234wr32
  6         99         12313be3
  7         96         12313be3
  5         95         12313be3
  </code></pre>
  
  <p>If I wanted ascending order, this is what I'd expect (I want to order only by the first row in one group, other rows in a single group do not matter):</p>
  
  <pre><code>row_id    percent    isrc
  6         99         12313be3
  7         96         12313be3
  5         95         12313be3
  1         100        123iee43
  3         98         123iee43
  2         100        1234wr32
  4         99         1234wr32
  </code></pre>
  
  <p>I guess I must use <em>window functions</em> somehow but was unable to find the correct solution if one exists. Also, it would be really neat if the solution was as <em>elegant</em> as possible. :)</p>