当我们向 AUTO_INCRMENT 列插入 NULL 值时,MySQL 将返回序列号。
示例
mysql> Create table employee(id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, Name Varchar(10)); Query OK, 0 rows affected (0.16 sec) mysql> Insert into employee(id, Name) values(NULL, 'Gaurav'); Query OK, 1 row affected (0.07 sec) mysql> Select * from employee; +----+---------+ | id | Name | +----+---------+ | 1 | Gaurav | +----+---------+ 1 row in set (0.00 sec)原文来自:www.php.cn
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
暂无评论内容