admin管理员组

文章数量:1487745

insert into 表名 set

insert into 表名 set

代码语言:javascript代码运行次数:0运行复制
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'
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。 原始发表:2023-12-24,如有侵权请联系 cloudcommunity@tencent 删除intnullsetdefaultinsert

本文标签: insert into 表名 set