sql: After all data in the table is deleted, when reinserting, it starts to increase from 1

Auto-increment columns are set in the database , and sometimes you need to clear the database to re-enter data . The most common way is to use the sql statement "delete  name " or directly select the data , and then delete the data . But when you insert the data again , you will It is found that the self-incrementing column will start from the next value of the maximum value of the last deleted data , not from 1. Do you have a feeling , I feel very distressed .

Now there is the simplest and most violent method . After you delete the data , when you insert the record again , the auto-increment column starts from 1 .

Directly from the table, modify the field that needs to be auto-incremented, cancel the auto-increment option, and then save it. After saving, define the field to auto-increment again, so that the sub-field will auto-increment from 1 again:

 

 

 

  

 

 

 

 

  above

  EMD

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324905378&siteId=291194637