title: How to select a max row for each group in SQL
body: <p>I want select countries with maximum value of 'Value' for a 'grpid'.  Also already selected 'Country' should not be considered for other 'grpid' while checking the maximum. ( ie Country or grpid should not be repeated in the result )</p>
  
  <p><strong><a href="http://www.sqlfiddle.com/#!3/fbf76/1" rel="noreferrer">SQL Fiddle</a></strong></p>
  
  <p><em><strong>Result:</em></strong></p>
  
  <pre><code>Country    grpid        Value           Row_number
  
  US        49707        604456458         1
  GB        5086         497654945         4 
  CA        909          353500201         10
  JP        231          198291290         15
  </code></pre>