|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Incrementing column in a queryHi:
I would like an incrementing column in result set of a select query. Numbers begin with 1 and increment by 1 for each row in result set. Does same as counter column in table. How do you do this? Thanks, Charlie
http://www.aspfaq.com/2427
Show quote "Charlie@CBFC" <char***@comcast.net> wrote in message
news:ua0eA5glGHA.408@TK2MSFTNGP03.phx.gbl... > Hi: > > I would like an incrementing column in result set of a select query. > Numbers begin with 1 and increment by 1 for each row in result set. Does > same as counter column in table. How do you do this? > > Thanks, > Charlie > > Lookup ROW_NUMBER() function in SQL Server Books Online.
For older versions, check: http://support.microsoft.com/kb/186133/en-us -- Anith |
|||||||||||||||||||||||