Start a sequence at 100 for an InnoDB table : InnoDB « Engine « SQL / MySQL






Start a sequence at 100 for an InnoDB table

        
mysql>
mysql> CREATE TABLE t
    -> (id INT UNSIGNED NOT NULL AUTO_INCREMENT, PRIMARY KEY (id))
    -> TYPE = InnoDB;
Query OK, 0 rows affected, 1 warning (0.01 sec)

mysql>
mysql> INSERT INTO t (id) VALUES(99);
Query OK, 1 row affected (0.00 sec)

mysql> INSERT INTO t (id) VALUES(NULL);
Query OK, 1 row affected (0.00 sec)

mysql> INSERT INTO t (id) VALUES(NULL);
Query OK, 1 row affected (0.00 sec)

mysql> INSERT INTO t (id) VALUES(NULL);
Query OK, 1 row affected (0.00 sec)

mysql> DELETE FROM t WHERE id = 99;
Query OK, 1 row affected (0.00 sec)

mysql> SELECT * FROM t ORDER BY id;
+-----+
| id  |
+-----+
| 100 |
| 101 |
| 102 |
+-----+
3 rows in set (0.00 sec)

mysql>
mysql> drop table t;
Query OK, 0 rows affected (0.00 sec)

mysql>

   
    
    
    
    
    
    
    
  








Related examples in the same category