gpt4 book ai didi

sql - Oracle SQL 中的多行插入

转载 作者:行者123 更新时间:2023-12-04 22:49:31 26 4
gpt4 key购买 nike

我在 oracle SQL 中使用多行插入语法,如下所示:

INSERT ALL
INTO student(ID, FIRST_NAME, LAST_NAME, AGE) VALUES(4,'test_name','test_lname',17)
INTO student(ID, FIRST_NAME, LAST_NAME, AGE) VALUES(5,'test_name2','test_lname2',20)
INTO student(ID, FIRST_NAME, LAST_NAME, AGE) VALUES(6,'test_name3','test_lname3',21)
select * from dual;

任何人都可以解释我使用的含义是什么

select * from dual



在和声明?

最佳答案

它是 INSERT ALL 的语法

INSERT ALL
INTO <table_name> VALUES <column_name_list)
INTO <table_name> VALUES <column_name_list)
...
<SELECT Statement>;

如果插入后没有任何要选择的内容,请执行 select * from dual
否则你做你通常想要确认插入成功的选择

reference

关于sql - Oracle SQL 中的多行插入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10868874/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com