select identity(int,1,1) as id,* into #temp from table select (select count(*) from tabel where a=AA.a and id<=AA.id),aa.* from table AA
select identity(int,1,1) as id, * into #temp from table select (select count(*) from #temp where a=AA.a and id<=AA.id) as GroupRecNO ,a,b,c from #temp AA
select identity(int,1,1) as id,* into #temp from table select (select count(*) from #temp where a=AA.a and id<=AA.id),aa.* from #temp AAdrop table #temp
select (select count(*) from tabel where a=AA.a and id<=AA.id),aa.* from table AA
select (select count(*) from #temp where a=AA.a and id<=AA.id) as GroupRecNO ,a,b,c from #temp AA
select (select count(*) from #temp where a=AA.a and id<=AA.id),aa.* from #temp AAdrop table #temp