MySQL sorting in the database after adding data
The data added at the beginning is incremented. And then it became like this. eg. Id:9 8 7 1 2 3 4 5 6 What sort of row is this? How do we get him to increment correctly?
------Solution--------------------
Is the ID an auto-growing column?
------Solution--------------------
I think you have a problem with the query, or the query shows a problem
------Solution--------------------
SQL Code
SELECT * FROM table order by id desc;
------Solution--------------------
Explore
The normal SELECT * from ' AA ' is all sorted in order. But the display is a bit strange. Is the MySQL version of the problem?
------Solution--------------------
There is an action that can reproduce your effect
MyISAM table
Insert data, and then delete the smaller ID, this time the table will be fragmented, and then insert the data
SELECT * From ... It will lead to this order.
If you delete the data, the OPTIMIZE table won't do that.
I'm guessing this could be a physical location.