Such as:
S_id s_no s_name
35051 001 Chen Wang
35052 002 Liang Song
35053 king cover 003
35054 004 spirit
.
.
.
I say you can understand clearly, please your timely help, thank you! Thank you very much
CodePudding user response:
SQL server has a rownumber function can realize the request of you, your Google,Access your cycle,
CodePudding user response:
Want to use the code realization,Build another table, for example, only one field, a record, the next number is 1 pet table, each time you add a record, update this table,
Don't adopt the method of cyclic update the original table number field, because the newly added record is not necessarily at the end of the recordset (unless the query in the Order By s_id, is numeric and s_id), each loop refresh causes changes in the serial number corresponding relation,
If does not require the serial number is continuous, after deleting records just to maintain the uniqueness, might as well use the built-in automatic numbering properties,
CodePudding user response: