markshen2004
Programmer
I have a name table.the structure like this now.the sort_order is incorrect because I alraedy delete some iterms manully.
I want to update the sort order and change it from 1 to n according to the current order
id name sort_order
9 John 9
16 Mark 16
27 Tony 27
45 Jim 45
I hope the data in the table like this after I run the stored procedure.
id name sort_order
9 John 1
16 Mark 2
27 Tony 3
45 Jim 4
Please give me a idea how to write the stored procedure. and let me know if it is possible a stored procedure can do it.
Thanks a lot
I want to update the sort order and change it from 1 to n according to the current order
id name sort_order
9 John 9
16 Mark 16
27 Tony 27
45 Jim 45
I hope the data in the table like this after I run the stored procedure.
id name sort_order
9 John 1
16 Mark 2
27 Tony 3
45 Jim 4
Please give me a idea how to write the stored procedure. and let me know if it is possible a stored procedure can do it.
Thanks a lot