for example, there is a table now, and id increases itself.
has a total of 100 pieces of data. When deleting 2 pieces of data from 50 items and deleting 2 pieces of data where 80 items are deleted
how to make id continuous?
for example, there is a table now, and id increases itself.
has a total of 100 pieces of data. When deleting 2 pieces of data from 50 items and deleting 2 pieces of data where 80 items are deleted
how to make id continuous?
depends on your needs, because the general self-increment id is related to joining other tables, so forced recovery of continuous self-increment is a disaster
if you ignore demand, there are two ways:
1 delete the self-incrementing field, and then rebuild
ALTER TABLE `tablename` DROP COLUMN `id`;
ALTER TABLE `tablename` ADD `id` int(10) unsigned NOT NULL AUTO_INCREMENT FIRST,ADD PRIMARY KEY (`id`), AUTO_INCREMENT = 0 ROW_FORMAT = COMPACT;
2 resets the self-incrementing field values sequentially through the sql statement
SET @i=0;
UPDATE `tablename` SET `id`=(@i:=@i+1);
ALTER TABLE `tablename` AUTO_INCREMENT=0;
Previous: The problem of promise red, green and blue lights realized by async/await
Next: Ask flutter to realize the method of downloading network pictures to the local area.
popularize the QR code what to do when 1 out of 1 million people cannot generate a QR code? ...
https: www.creams.io , for example, how can you tell what language his background is written in? ...
firewall, the integrated environment of system Centos7, lnmp.org, does not have the permission to run mysql. Iptables has been restarted. Refresh authorization error: Mysql user:Iptables: New processing: 1. Modify mysql configuration file vi ...
which language has more advantages in building short video websites? The mobile phone will be used later. Is there any similar source code reference for ? ...
how to quickly convert multiple csv files into xls files in batches ...
this is the dash, on windows is the same as DASH on MAC. Looking at the picture above, downloading the document has been failing. Is the server down and no longer providing services? ...
regular: ^ [u4e00-u9fa5] + (- [u4e00-u9fa5] +) * $ description: for matching Chinese names found on the Internet, ethnic minorities are separated by horizontal lines. I now want to limit the overall length to 2-6 digits for advice. Thank you in adv...
webserver parses and forwards the accepted HTTP request packet to the CGI program. What is the basis for inter-process communication? Webserver and CGI programs may be on the same server or on different servers. Is there any way I can capture their traff...
What s the use of ? ...
good evening, big gods. I have this need: the PHP server acts as a middleman to communicate between the mobile app end and the hardware device (roughly like this, some words may be unprofessional). In some cases, the app side and the hardware side take t...
1, my gitlab, has been stuck here since I clicked two steps to verify it because of my disabled hand. As shown in figure 2, please tell me how to turn this off. Thank you ...
the code in this book is all Python. I have never seen Python, ask for the PHP code in this book. Thank you ....
A large binary tree with uncertain tree hierarchy. Now we need to realize the following requirements: 1. Record hierarchical relationships. For example: to give you a node id:9, needs to find out the son or grandson under this node, or. Or all descenda...
are there any book recommendations for source code analysis? for example, when I open the source code of some GitHub open source projects, there are many design structures that I don t quite understand, and some code that I don t understand. Are the...
how to quickly copy a row in vscode? Is the operation of webstrom ctrl+D? ...
does this function require front and rear cooperation? Or can it be completed as long as the front end? the requirement is to fill in the project name. Multiple project names automatically appear in the box below. Click on the input box above, and the ...
I would like to ask , for example, how to make a website how to let users automatically issue a registration code to users through Wechat s top-up charge, and how to design and write the ideas recommended by bosses who have done it. Thank you ~ ....
title: XQuery ypenz is three different elements of an array of integers. Find all the combinations of x = y + z and use a better algorithm as much as possible on the basis of realizing the requirements of the topic. my implementation code: $arr = [1,...
I ve heard that the mecab participle is easy to use. I d like to try it, but I can t download it and ask for a copy from the passing Gang. Thank you official website address http: taku910.github.io meca. Windows address https: drive.google.co...
when a rookie at the front end is working on a small project <?php header("Content-type: text html;charset=utf-8"); 1 $conn=@mysql_connect("localhost","root","0123456zp"); if(!$conn){ mysql_error()my...