博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
oracle update语句的几点写法
阅读量:5742 次
发布时间:2019-06-18

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

update两表关联的写法包括字查询 

1.update t2 set parentid=(select ownerid from t1 where t1.id=t2.id); 
2. 
update tb_client_win_lost_report a set a.rolling_code_id=2 
where game_code_id=70000 
and exists 
(select 'x' from (select a.id 
from (select id,level_ from tb_admin_role connect by prior id=parent_id start with id =1) a, 
(select lv_id from tb_rolling_plan where rolling_code_id = 2 and game_code_id=70000) b 
where b.lv_id=a.id) c where a.role_id=c.id) 
and rolling_code_id=1 
3. 
update (select rolling_code_id from tb_client_win_lost_report a,temp_role_id b 
where a.role_id=b.id 
and rolling_code_id=1) a set a.rolling_code_id=2; 
4. 
update tb_client_win_lost_report a set a.rolling_code_id=2 
where game_code_id=70000 
and exists 
(select 'x' from (select id from temp_role_id) c where a.role_id=c.id) 
and rolling_code_id=1 
and rownum<100000; 
commit; 

5.

update 多个字段的写法 

update a set (c1,c2,c3) =(select b1,b2,b3 from b where......) where ......; 

转载地址:http://usizx.baihongyu.com/

你可能感兴趣的文章
siki学习之观察者模式笔记
查看>>
单元测试
查看>>
spring.net 继承
查看>>
ES6:模块简单解释
查看>>
JavaScript indexOf() 方法
查看>>
用Bootstrap写一份简历
查看>>
ZJU PAT 1023
查看>>
WMI远程访问问题解决方法
查看>>
从零开始学习IOS,(UILabel控件)详细使用和特殊效果
查看>>
Android开发历程_15(AppWidget的使用)
查看>>
阿花宝宝 Java 笔记 之 初识java
查看>>
7、设计模式-创建型模式-建造者模式
查看>>
Cesium官方教程11--建模人员必读
查看>>
我国古代的勾股定理
查看>>
Linux下的C编程实战
查看>>
[32期] html中部分代码与英语单词关系
查看>>
PHP安装环境,服务器不支持curl_exec的解决办法
查看>>
jQuery|元素遍历
查看>>
RedHat 6 安装配置Apache 2.2
查看>>
Openstack 安装部署指南翻译系列 之 Manila服务安装(Share Storage)
查看>>