Christopher,
Its very nice query but here is my issue which is little bit different than above,
I am having same issue on SQL 03 where I can not use Row_Number()
What I have in my table is below:
IDFnameLnameAmount
1SmithJohnson$12.32
1SmithJohnson$23.32
2MelindaBen$23.09
2MelindaBen$45.32
2MelindaBen$566.00
And here is what I am trying to accomplish:
IDID_Line_NoFnameLnameAmount
11 SmithJohnson$12.32
12 SmithJohnson$23.32
21 MelindaBen$23.09
22 MelindaBen$45.32
23 MelindaBen$566.00
I would like to get "ID_Line_No" column where number increse when ID number change. so, as you see above that when ID = 1 and I have two records for Mr.Smith so, my code should identify each row starting with 1,2,...
It is easy in SQL 2005 but I have one client that use SQL 2003.
Please advice,