Here I am using incremental value for every row creations.
When i am going to delete the last row example-10, next row creations take 11 instead of taking next value from 9. Please help me to get exact value after row deletions on mysql table. And please find my structure.
CREATE TABLE `orders` (
`order_id` int NOT NULL AUTO_INCREMENT,
`order_date` date NOT NULL,
`customer_name` varchar(255) NOT NULL,
`customer_mobile_number` varchar(255) NOT NULL,
`sub_total` varchar(255) NOT NULL,
`vat` varchar(255) NOT NULL,
`total_amount` varchar(255) NOT NULL,
`overall_discount` varchar(255) NOT NULL,
`grand_total` varchar(255) NOT NULL,
`paid` varchar(255) NOT NULL,
`due` varchar(255) NOT NULL,
`payment_type` int NOT NULL,
`payment_status` int NOT NULL,
`payment_place` int NOT NULL,
`gstn` varchar(255) NOT NULL,
`order_status` int NOT NULL DEFAULT '0',
`user_id` int NOT NULL,
`customer_location` varchar(255) NOT NULL,
`attendor` varchar(255) NOT NULL,
`quantity` bigint DEFAULT NULL,
PRIMARY KEY (`order_id`)
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=latin1 |
question from:
https://stackoverflow.com/questions/65888239/mysql-need-to-take-next-value-for-id-in-mysql-table-after-a-row-deletions 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…