I'm not very close to the database, and in fact I do not even need such functionality, but just for the sake of curiosity, it's possible to create in runtime , that is, during SELECT , a sequential numbering to be used in substitution of the auto-incremental values of a primary key, without changing any value, only facilitating the work of the server-side language?
Consider this example SQLFiddle .
There are three tables in it, and the third only lists the other two tables. I know this type of intermediate table has a proper name, but I do not remember>.
The way the simple query was mounted, when rendering an HTML from a resource in that query, if I show the values in the sid column it would look visually strange, for example, rowset with three records start your listing by number four.
With the server-side language it would be enough to get the current index of the iteration over the resource and use that value instead of the one in the column. Or I could put together an unordered list and renumber it with CSS (3).
But is it directly from the query ? Is it possible?