"how to generate serial number in a query?" Code Answer


you have two options.

either upgrade to postgresql v8.4 and use the row_number() function:

select row_number() over (order by something) as num_by_something, *
from table
order by something;

or jump through some hoops as described in simulating row number in postgresql pre 8.4.

By Philip.ie on August 21 2022

Answers related to “how to generate serial number in a query?”

Only authorized users can answer the Search term. Please sign in first, or register a free account.