Oracle中Insert语句的总结

来源:互联网 发布:淘宝网店从哪开 编辑:程序博客网 时间:2024/05/16 05:22

在oracle中,insert语句的使用:

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

     

 

 

原创粉丝点击