I know I've seen this before, but I haven't had success Googling it.
I have a table like this
create table #tmp
(
iuserid int,
vchGroupName varchar(50),
vchIncrement varchar(20)
)
The data I have would look like this
insert #tmp
select 1,'groupa',''
union all
select 2,'groupa',''
union all
select 3,'groupa',''
union all
select 4,'groupb',''
union all
select 5,'groupb',''
and the result I'm looking for is
1,groupa,1
2,groupa,2
3,groupa,3
4,groupb,1
5,groupb,2
there are articles on doing this for 2005 with the over clause but I couldn't find one for 2000
Thanks ๐