title: How to add ROW INDEX as a column to SQL SELECT query?
body: <p>Assume I've SQL query like this:</p>
  
  <pre><code>SELECT id, name, index(not a real column) FROM users ORDER BY rating DESC
  </code></pre>
  
  <p>I want to add column to selected columns that will represent the index of the record.</p>
  
  <p>Example:</p>
  
  <pre><code> id    name  rating
   1     a     4
   2     b     2
   3     c     8
   4     d     5
  </code></pre>
  
  <p>For this table I want to get:</p>
  
  <pre><code> id    name  rating  index
   3     c     8       1
   4     d     5       2
   1     a     4       3
   2     b     2       4
  </code></pre>