Get the data into a table variable with identity column.. Declare @T Table (rowid int identity,Cust_Name varchar(10), Month2 int)Insert into @T Select 'Gilbert' , 5 union allSelect 'Gilbert' , 4 union allSelect 'Gilbert' , 7 union allSelect 'Martin' , 3 union allSelect 'Martin' , 9Select (Select count(*) From @T T2 Where T2.Cust_Name = T.Cust_Name And T2.rowid <= T.rowid ) As RowNum, *from @T T
Dinakar Nethi************************Life is short. Enjoy it.************************http://weblogs.sqlteam.com/dinakar/