I need to reset auto_increment in mysql a scenario,
Code:
+----+---------+---------------+------+---------------------+------------+
| id | HEADING | BODY | FLAG | creation_date | IMAGE |
+----+---------+---------------+------+---------------------+------------+
| 1 | asd |asdasdasdas | 0 | 2009-06-18 15:46:01 | Winter.jpg |
| 2 | sdf |ZZxsdsadsas | 0 | 2009-06-18 15:49:01 | human.jpg |
| 3 | dgdf |gdfgdf | 0 | 2009-06-18 15:52:33 | Sunset.jpg |
+----+---------+---------------+------+---------------------+------------+
3 rows in set (0.00 sec)
If i delete the 3 number data, then i can regenerate the auto_increment by issuing this query:
Code:
ALTER TABLE table_name AUTO_INCREMENT=1
what to do if i delete 2 number data, and after that need to reset auto_increment.
example:
Code:
+----+---------+---------------+------+---------------------+------------+
| id | HEADING | BODY | FLAG | creation_date | IMAGE |
+----+---------+---------------+------+---------------------+------------+
| 1 | asd |asdasdasdas | 0 | 2009-06-18 15:46:01 | Winter.jpg |
| 3 | dgdf |gdfgdf | 0 | 2009-06-18 15:52:33 | Sunset.jpg |
+----+---------+---------------+------+---------------------+------------+
2 rows in set (0.00 sec)
Pl. it needed very urgently...
Thanks
Regards
Manish Singh