Displaying serial nos for output rows.

  • Hi,

    I want to know if there is any possibility to add a column for a dynamically constructed sql query which should show up the serial nos (1 2 3 ..) for the number of rows it displays as output.

    Thanks in advance.

     


    Lucky

  • There is, but....

    It's possible to do it 'on the fly' in a select, but this has serious performance considerations once the underlying data is more than just tiny.

    Another easy workaround is to insert your initial select into a temptable with an identity column, and then select from that.

    Finally, the current 'most fitting all' recommendation is to do the numbering in the client app.

    /Kenneth

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply