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发布者:admin,转转请注明出处:http://www.yc00.com/web/1754974567a5223457.html
评论列表(0条)