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语句的几点写法的更多相关文章

  1. Oracle Update 语句语法与性能分析 - 多表关联

    Oracle Update 语句语法与性能分析 - 多表关联   为了方便起见,建立了以下简单模型,和构造了部分测试数据: 在某个业务受理子系统BSS中, SQL 代码 --客户资料表 create ...

  2. [oracle] update语句卡住问题

    执行update语句的时候发现执行半天不成功 update main_order set order_source = '2', order_status = '2' 查询哪些对象被锁 select ...

  3. Oracle Update语句

    Oracle没有update from语法,可以通过四种写法实现同样的功能: 一.标准update语法(常用.速度可能最慢) 当更新的表示单个或者被更新的字段不需要关联表带过来,此法是最好的选择. u ...

  4. Oracle update语句更新值来自另一张表中的数据

    task 任务表 role 角色表 两表之间必须有关联的字段 update task t set t.roleName = ( select r.name from role r where r.id ...

  5. [oracle] update和merge语句的几点写法

    1.update t2 set parentid=(select ownerid from t1 where t1.id=t2.id); 2. update tb_client_win_lost_re ...

  6. Oracle的update语句优化研究

    最近研究sql优化,以下文章转自互联网: 1.     语法 单表:UPDATE 表名称 SET 列名称 = 新值 WHERE 列名称 = 某值 如:update t_join_situation s ...

  7. [转]Oracle的update语句优化研究

    原文地址:http://blog.csdn.net/u011721927/article/details/39228001 一.         update语句的语法与原理 1.     语法 单表 ...

  8. ORACLE多表关联UPDATE 语句

    转载至:http://blog.itpub.net/29378313/viewspace-1064069/ 为了方便起见,建立了以下简单模型,和构造了部分测试数据:在某个业务受理子系统BSS中, SQ ...

  9. oracle执行update语句时卡住问题分析及解决办法

    转载:http://www.jb51.net/article/125754.htm 这篇文章主要介绍了oracle执行update语句时卡住问题分析及解决办法,涉及记录锁等相关知识,具有一定参考价值, ...

随机推荐

  1. poj 1094 Sorting It All Out_拓扑排序

    题意:是否唯一确定顺序,根据情况输出 #include <iostream> #include<cstdio> #include<cstring> #include ...

  2. 学用 ASP.Net 之 System.Math 类

    本文来自:http://www.cnblogs.com/del/archive/2011/01/03/1924746.html   成员: /* 字段 */ Math.E;      //2.7182 ...

  3. Stopwatch 类【转】

    一般我们想要测试使用那种方法或着那种类型效率更高,使用Stopwatch类进行测试就可以,我也是现在才知道,汗一个. 先来看个小示例,如下. 前提,先引用using System.Diagnostic ...

  4. SEO,你敢说你会吗?

    SEO从何開始学起?SEO基础知识我们须要掌握哪些?SEO是什么?SEO究竟要怎么做?这些问题无时无刻不在困惑着我们.就我个人一些小观点来谈谈一个站点优化的大致步骤. SEO初期阶段 空间域名:空间跟 ...

  5. OC中NSString 的常用方法

    NSString *str1 = @"BeiJing"; NSString *str2 = @"beijing"; //全部转为大写 NSLog(@" ...

  6. windows7旗舰版64位下安装、破解及执行QTP11报错

    说明:假设你出现了下面几种情况,希望能解决你的问题:假设没有,就当路过. 1.安装qtp11时报vc++ 2005缺少,但怎么也不能安装成功 解决方法: 1.找到qtp安装包里面的vc++ 2005组 ...

  7. Ext布局篇

      EXT标准布局类 收藏 面板相当于一张干净的白纸,如果直接在上面添加内容,将很难控制面板中内容的显示位置,面板元素越多就越显得凌乱,所以需要在面板上划分不同的区域,将面板内容展示到希望的位置上.E ...

  8. 在 WinForm 中打开页面采用POST方式传参http。可以多个参数传递,返回json字符串

    //调用方法 Dictionary<string, string> postData = new Dictionary<string, string>(); postData. ...

  9. spring+hibernate

    添加注解时spring是添加在set方法上而hibernate是添加在get方法上 事务应该加在service层上,而不是加在dao层上,如果加在dao层上回滚的时候只能回滚一个dao的实现. 事务处 ...

  10. SQL Server2012 创建定时作业——图文并茂,教你轻松快速创建

    SQL Server2012 如何创建定时作业?有兴趣的可以来看下,图文并茂哦! 1.首先我们打开SQL Server代理,里面选择作业 2.右键作业,选择新建作业 3.填写一些相应的内容,名称和说明 ...