oracle update语句的几点写法
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 ......;
oracle update语句的几点写法的更多相关文章
- Oracle Update 语句语法与性能分析 - 多表关联
Oracle Update 语句语法与性能分析 - 多表关联 为了方便起见,建立了以下简单模型,和构造了部分测试数据: 在某个业务受理子系统BSS中, SQL 代码 --客户资料表 create ...
- [oracle] update语句卡住问题
执行update语句的时候发现执行半天不成功 update main_order set order_source = '2', order_status = '2' 查询哪些对象被锁 select ...
- Oracle Update语句
Oracle没有update from语法,可以通过四种写法实现同样的功能: 一.标准update语法(常用.速度可能最慢) 当更新的表示单个或者被更新的字段不需要关联表带过来,此法是最好的选择. u ...
- Oracle update语句更新值来自另一张表中的数据
task 任务表 role 角色表 两表之间必须有关联的字段 update task t set t.roleName = ( select r.name from role r where r.id ...
- [oracle] update和merge语句的几点写法
1.update t2 set parentid=(select ownerid from t1 where t1.id=t2.id); 2. update tb_client_win_lost_re ...
- Oracle的update语句优化研究
最近研究sql优化,以下文章转自互联网: 1. 语法 单表:UPDATE 表名称 SET 列名称 = 新值 WHERE 列名称 = 某值 如:update t_join_situation s ...
- [转]Oracle的update语句优化研究
原文地址:http://blog.csdn.net/u011721927/article/details/39228001 一. update语句的语法与原理 1. 语法 单表 ...
- ORACLE多表关联UPDATE 语句
转载至:http://blog.itpub.net/29378313/viewspace-1064069/ 为了方便起见,建立了以下简单模型,和构造了部分测试数据:在某个业务受理子系统BSS中, SQ ...
- oracle执行update语句时卡住问题分析及解决办法
转载:http://www.jb51.net/article/125754.htm 这篇文章主要介绍了oracle执行update语句时卡住问题分析及解决办法,涉及记录锁等相关知识,具有一定参考价值, ...
随机推荐
- Redmine backlogs 安装
之前我们一直用IceScrum的免费版本来运作Scrum项目,用GitLab来做做Issue管理,但是出现了一些问题.GitLab的issue不够好用,不能满足我们的需求,同时issue没有办法放在S ...
- 十分钟让你明白Objective-C的语法(和Java、C++的对比)
很多想开发iOS,或者正在开发iOS的程序员以前都做过Java或者C++,当第一次看到Objective-C的代码时都会头 疼,Objective-C的代码在语法上和Java, C++有着很大的区别, ...
- Android学习之Notification
Notification可以在手机的状态栏发出一则通知,它需要用NotificationManager来管理,实现Notification其实很简单. 1.通过getsystemservice方法获得 ...
- C#5 复习总结循环 迭代和穷举
一.章节复习: 循环.反复执行某段语句一种语法形式. 1.基本语法: for( 初始条件 ; 循环条件 ; 状态的改变 ) { 循环体 } 循环的四要素. 循环的执行过程.初始条件--循环条件--循环 ...
- (转)OpenGL中位图的操作(glReadPixels,glDrawPixels和glCopyPixels应用举例)
(一)BMP文件格式简单介绍 BMP文件是一种像素文件,它保存了一幅图象中所有的像素.这种文件格式可以保存单色位图.16色或256色索引模式像素图.24位真彩色图象,每种模式种单一像素的大小分别为1/ ...
- shell ps1 提示设置
PS1="\[\033[01;37m\]\u\[\033[00m\]@\[\033[01;31m\]localhost \t\[\033[00m\]:\[\033[01;35m\]\w\[\ ...
- 原生JS研究:学习jquery源码,收集整理常用JS函数
原生JS研究:学习jquery源码,收集整理常用JS函数: 1. JS获取原生class(getElementsByClass) 转自:http://blog.csdn.net/kongjiea/ar ...
- Java Notes 00 - Singleton Pattern(单例总结)
转:http://hukai.me/java-notes-singleton-pattern/ 这里不赘述单例模式的概念了,直接演示几种不同的实现方式. 0)Eager initialization ...
- 为程序指定运行时所在的CPU核
internal class Program { [DllImport("kernel32.dll")] private static extern uint GetTickCou ...
- C语言入门(19)——C语言的编码风格
代码风格好不好就像字写得好不好看一样,如果一个公司招聘秘书,肯定不要字写得难看的,同理,代码风格糟糕的程序员肯定也是不称职的.虽然编译器不会挑剔难看的代码,照样能编译通过,但是和你一个团队进行协作的其 ...