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
it is for https://data.stackexchange.com/
try:
If it's Oracle, use
rownum
.The final answer will entirely depend on what database you're using.
How you'd do that depends on your database server. In SQL Server, you could use
row_number()
:But it's often easier and faster to use client side row numbers.
For MySql:
use rownumber function available in sql server