insert into 表名 set

发布时间 2023-12-24 18:51:31作者: oktokeep
#insert into 表名 set

CREATE TABLE `tbl_str` ( `id` INT DEFAULT NULL, `Str` VARCHAR(30) DEFAULT NULL ) ##批量 INSERT INTO `mytest`.`tbl_str` (`id`, `Str`) VALUE ('1', 'hello world'), ('2', 'mysql string'), ('3', 'hello'); ##value和values都可以 ##单条 INSERT INTO `mytest`.`tbl_str` (`id`, `Str`) VALUE ('4', 'hello world2'); ##可以单条添加 INSERT INTO `mytest`.`tbl_str` SET id = 10,str = 'nihao' #多条不可以 #INSERT INTO `mytest`.`tbl_str` #SET id = 11,str = 'dbadmin' #SET id = 12,str = 'dbadmin2'