title: Enumerate in postgresql
body: <p>Is there any way to enumerate rows of query in postgresql? </p>
  
  <p>I have table like this:</p>
  
  <pre><code>Table players
  id player_id game_id points
  </code></pre>
  
  <p>And I want query like this:</p>
  
  <pre><code>SELECT  game_id, &lt;row_number in points group&gt;, &lt;array of ids&gt; 
      FROM players WHERE game_id = %s 
      GROUP BY game_id, points; 
  </code></pre>