I have a table called OrderDetails with the fields OrderID (existing field) and OrderLine (a new filed).
Below is a snippet of data.
OrderID OrderLine
-------------------------
10248 NULL
10248 NULL
10248 NULL
10249 NULL
10249 NULL
10250 NULL
10250 NULL
10250 NULL
10250 NULL
10250 NULL
10251 NULL
10251 NULL
10251 NULL
What I'm trying to do is UPDATE the OrderLine with a sequential number for each (same) OrderID. See below for an illustration.
OrderID OrderLine
-------------------------
10248 1
10248 2
10248 3
10249 1
10249 2
10250 1
10250 2
10250 3
10250 4
10250 5
10251 1
10251 2
10251 3
Can someone be kind enough to help me out - preferably with code - with my problem?
Thanks
Below is a snippet of data.
OrderID OrderLine
-------------------------
10248 NULL
10248 NULL
10248 NULL
10249 NULL
10249 NULL
10250 NULL
10250 NULL
10250 NULL
10250 NULL
10250 NULL
10251 NULL
10251 NULL
10251 NULL
What I'm trying to do is UPDATE the OrderLine with a sequential number for each (same) OrderID. See below for an illustration.
OrderID OrderLine
-------------------------
10248 1
10248 2
10248 3
10249 1
10249 2
10250 1
10250 2
10250 3
10250 4
10250 5
10251 1
10251 2
10251 3
Can someone be kind enough to help me out - preferably with code - with my problem?
Thanks