Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 record counter

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2000-11-08 : 00:14:16
Jim writes "
I'm trying to write a select that returns a result set with a counter added on. I want to do it without using an identity column or cursor. Something along the lines of
select col1, (select max(col2)+1 from tab1) from tab1.
I get (as expected)

col1     
------- ------
a 25
b 25
c 25


I want

col1     
------- ------
a 25
b 26
c 27


Thanks,

Jim"
   

- Advertisement -