ITPub博客

首页 > 数据库 > Oracle > Oracle中Insert语句的总结

Oracle中Insert语句的总结

原创 Oracle 作者:gulunhua 时间:2016-01-25 18:24:52 0 删除 编辑

在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

     


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/653220/viewspace-1982111/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2011-08-01

  • 博文量
    41
  • 访问量
    53154