Oracle中Insert语句的总结

2014-11-24 18:31:41 · 作者: · 浏览: 0

1、insert into 表1(列名1,列名2,……) values(值1,值2,……)


2、insert into 表1(列名1,列名2,……)


select 列名1,列名2,…… from 表2


3、insert all --无条件添加


into 表1 values(列名1,列名2,……)


into 表2 values(列名1,列名2,……)


select 列名1,列名2,…… from 表3


4、insert all --如果条件满足,则添加


when 条件1 then into 表1 values(列名1,列名2,……)


when 条件2 then into 表1 values(列名1,列名2,……)


select 列名1,列名2,…… from 表3


5、insert first --对于第一个满足的条件,则添加


when 条件1 then into 表1 values(列名1,列名2,……)


when 条件2 then into 表1 values(列名1,列名2,……)


select 列名1,列名2,…… from 表3