在mysql常用命令与数据导入导出中记录过常用的sql语句,其中包括了插入语句.
今天单独记录一下mysql的插入语句的更多用法....into
这是最常用的插入语句,具体示例如下:
insert into student(name,classNum) values("test2",20);
在数据库中成功插入了一条:名字为test2...,但是test2在数据库中主键已经存在,那么使用replace语句执行插入后,会发现,主键为test2的值仍然存在,但是classNum替换为了21.
insert ignore into
当主键重复时...这种情形下我们可以使用insert ignore into语句,示例如下:
mysql> select * from student;
+-----------+----------+
| name...联系邮箱:huyanshi2580@gmail.com
更多学习笔记见个人博客——>呼延十
var gitment = new Gitment({ id: 'Mysql之多种 Insert语句',