delete and reinsert value to AUTO_INCREMENT column
mysql>
mysql> CREATE TABLE CITY_NAMES
-> (SEQNO INTEGER UNSIGNED AUTO_INCREMENT
-> NOT NULL PRIMARY KEY,
-> NAME VARCHAR(30) NOT NULL);
Query OK, 0 rows affected (0.00 sec)
mysql>
mysql>
mysql> DELETE FROM CITY_NAMES
-> ;
Query OK, 0 rows affected (0.00 sec)
mysql> INSERT INTO CITY_NAMES VALUES (NULL, 'Phoenix')
-> ;
Query OK, 1 row affected (0.00 sec)
mysql> INSERT INTO CITY_NAMES VALUES (NULL, 'Rome');
Query OK, 1 row affected (0.00 sec)
mysql>
mysql>
mysql> drop table CITY_NAMES;
Query OK, 0 rows affected (0.00 sec)
mysql>
Related examples in the same category