Mega Code Archive

 
Categories / MySQL / Data Type
 

SET @@AUTO_INCREMENT_OFFSET = 10,@@AUTO_INCREMENT_INCREMENT = 10

mysql> mysql> mysql> SET @@AUTO_INCREMENT_OFFSET = 10,     ->     @@AUTO_INCREMENT_INCREMENT = 10     -> ; Query OK, 0 rows affected (0.00 sec) mysql> CREATE TABLE T10     ->       (SEQNO  INTEGER AUTO_INCREMENT NOT NULL PRIMARY KEY)     -> ; Query OK, 0 rows affected (0.00 sec) mysql> INSERT INTO T10 VALUES (NULL),(NULL)     -> ; Query OK, 2 rows affected (0.00 sec) Records: 2  Duplicates: 0  Warnings: 0 mysql> SELECT * FROM T10; +-------+ | SEQNO | +-------+ |    10 | |    20 | +-------+ 2 rows in set (0.00 sec) mysql> mysql> drop table T10; Query OK, 0 rows affected (0.00 sec) mysql>