oracle数据库表⼀次性插⼊多条记录的SQL语句⽂章⽬录
纯情少男
经常使⽤MySQL数据库我想要数据库⾥批量插⼊⼀些数据,⼀条INSERT语句插⼊批量数据的写法为:INSERT INTO[表名]([列名],[列名])
ai程序员需要掌握什么VALUES([列值],[列值])),
([列值],[列值])),
([列值],[列值]));
翻车
but,我在oracle数据⾥翻车了,mysql⾥的这种写法在oracle中是不⽀持的
this love instrumental翻译掰直
weight什么意思翻译1. ⼀个很简单的⽅法就是,⼀条⼀条的来
2. 可是,我仍然想要⼀次性插⼊多条记录,⽅法如下:
建表前端面试题题库
CREATE TABLE test(
teacher_id INTEGER,
teacher_name VARCHAR2(32),
sex VARCHAR2(4),
subject VARCHAR2(32)
)
插值
insert all
into test(teacher_id,teacher_name,sex,subject)values(1,'张1','男','语⽂') into test(teacher_id,teacher_
name,sex,subject)values(2,'张2','⼥','数学') into test(teacher_id,teacher_name,sex,subject)values(3,'张3','⼥','英语') into test(teacher_id,teacher_name,sex,subject)values(4,'张4','男','物理') into test(teacher_id,teacher_name,sex,subject)values(5,'张5','⼥','化学') into test(teacher_id,teacher_name,sex,subject)values(6,'张6','⼥','⽣物') into test(teacher_id,teacher_name,sex,subject)values(7,'Jack','男','历史') into test(teacher_id,teacher_name,sex,subject)values(8,'张8','男','地理') into test(teacher_id,teacher_name,sex,subject)values(9,'张9','⼥','政治') into test(teacher_id,teacher_name,sex,subject)values(10,'张10','⼥','语⽂') select1from dual;
厄瓜多尔小组赛最终结果:
mysql语句转oracle
特别说明:
dual是Oracle提供的最⼩的⼯作表,只有⼀⾏⼀列,具有某些特殊功⽤,它是⼀个虚拟表,⽤来构成select的语法规则,oracle保证dual⾥⾯永远只有⼀条记录,可以⽤它来做很多事情,⽐如本次教程⾥的select 1 from dual这句话不能丢,不然会报语法错误,⽽且这句话的作⽤也仅仅是让sql语法正确!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论