Tuesday, April 2, 2013

set row value in numeric order if your data position is unformate

old
inserted Id
2
5
4
3
new
inserted Id
1
2
3
4


alter table table_name drop id;

 ALTER TABLE `table_nmae` ADD `id` INT(255) NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY (`id`)

you have to run both code at a same type

No comments:

Post a Comment