I have orders and order details table as shown as below:
OrderDetails
Order_ID int
Order_Code varchar(10)
Product Name varchar(50)
Qty Int
SeqNO varchar(10)
Below are the sample records
10001 OC Ottoman 10 Null
10002 OC Ottoman 3 Null
10003 OC Ottoman 2 Null
10004 OC Ottoman 2 Null
Is there anyway I can update the SeqNo column with 1, 1A,1B,1C if the Order_Code is same else it should increment by one.
for example
10001 OC Ottoman 10 Null
10002 OD Ottoman 3 Null
10003 OE Ottoman 2 Null
10004 OF Ottoman 2 Null
this one should be 1,2,3,4
Please help
Not sure if I understand everything, but take a look at this example:
Returns
Hope this helps.
UPDATE
To update and have
1, 1A, 1B..use:Beware what happens when you get more than
1, 1A, ... 1Zdifferent order numbers for Ottomans.