博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Oracle 数据操作
阅读量:6860 次
发布时间:2019-06-26

本文共 927 字,大约阅读时间需要 3 分钟。

  hot3.png

插入 insert into

insert into um_user values('10001','tom','男','上海');insert into um_user(usercode,username) values('10001','tom');insert into um_user                 select *from user;

删除 delete

delete from um_user;--删除表中所有数据delete from um_user where usercode='10001';--删除表中符合条件的数据

###更新 update

update um_user set name='lilei' ;--更新表中所有数据update um_user set name='lilei' where usercode='10001';--更新表中符合条件的数据

无条件多表插入

insert allinto user1 values(usercode,username,sex,place)into user2 values(usercode,username,sex,place)select *from um_user;

有条件多表插入

insert first:同一个符合插入第一个,其余不插入,insert all:符合就插入

insert firstwhen sex='男' then into user1 values(usercode,username,sex,place)when sex='女' then into user2 values(usercode,username,sex,place)select *from um_user;

子查询更新

update um_user set sal=(select avg(sal)from um_user);

事物操作

  1. commit;
  2. rollback;
  3. savepoint name;
  4. rollback to [savepoint] name;

转载于:https://my.oschina.net/di7633/blog/788595

你可能感兴趣的文章
11.11评价
查看>>
第一章--第一节:环境搭建
查看>>
hdu 2665 划分树
查看>>
hdu 4251 划分树
查看>>
poj 1704 Georgia and Bob(阶梯博弈)
查看>>
JQuery中的$.ajax()
查看>>
js 幻灯片
查看>>
Keras序列模型学习
查看>>
[bzoj2809] 派遣
查看>>
Windows2003上使用IIS7 Express使用FastCgi运行php
查看>>
安装程序时 “向数据库写入数据时发生错误!”
查看>>
图文:高春辉和他的网站梦
查看>>
网页之间的参数传递
查看>>
初步学习Django-第四篇:views.PY文件详解
查看>>
OAuth2简易实战(四)-Github社交联合登录
查看>>
Netty学习大纲
查看>>
OC中的私有方法
查看>>
分享几段JavaScript
查看>>
C++中的多态和Objective-C中的“多态”
查看>>
js基础五
查看>>