Assume I've SQL query like this:
SELECT id, name, index(not a real column) FROM users ORDER BY rating DESC
I want to add column to selected columns that will represent the index of the record.
Example:
id name rating
1 a 4
2 b 2
3 c 8
4 d 5
For this table I want to get:
id name rating index
3 c 8 1
4 d 5 2
1 a 4 3
2 b 2 4