September 13, 2005 at 1:50 pm
I am going to use a very simple table to explain my question.
Table-1 have columns of C1 and C2.
The records could be:
Car, 0
Car,0
Plane, 0
Plane, 0
Plane, 0
and we need to make the data look like:
Car, 1
Car, 2
Plane, 1
Plane, 2
Plane, 3
e.g. if we group the column C1, within each group C1 needs to be like a sequence number.
can it be done relative easy without using cursor?
thanks a lot.
September 13, 2005 at 1:57 pm
It can be done but why do you want to do that??
September 13, 2005 at 2:04 pm
We are using an existing design and have no control with it. so re-design the table is out of question. So we have no choice but to accommodate the request.
September 13, 2005 at 8:12 pm
Check the final update statement of the first post of this thread.
September 14, 2005 at 2:07 am
Or check this thread:
http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=8&messageid=216410
I didn't know Remi's solution when I posted my solution, and Remi normally has the fastest solution, but just in case....
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply