How to enumerate returned rows in SQL?

Posted by SilentGhost on Stack Overflow See other posts from Stack Overflow or by SilentGhost
Published on 2010-06-15T18:07:17Z Indexed on 2010/06/15 18:12 UTC
Read the original article Hit count: 145

Filed under:
|
|

I was wondering if it would be possible to enumerate returned rows. Not according to any column content but just yielding a sequential integer index. E.g.

select ?, count(*) as usercount from users group by age

would return something along the lines:

1    12
2    78
3     4
4    42

© Stack Overflow or respective owner

Related posts about sql

Related posts about beginner