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. TX enqueue DRM

  2. 格而知之1:UIButton中imageView和titleLabel的位置调整

    在使用UIButton时,有时候需要调整按钮内部的imageView和titleLabel的位置和尺寸.在默认情况下,按钮内部的imageView和titleLabel的显示效果是图片在左文字在右,然 ...

  3. 【枚举+贪心】【ZOJ3715】【Kindergarten Electiond】

    题目大意: n 个人 在选取班长 1号十分想当班长,他已经知道其他人选择了谁,但他可以贿赂其他人改选他,问贿赂的最小值 ps.他自己也要投一个人 要处理一个问题是,他自己投谁 其实这个问题在这种局面下 ...

  4. UVA 11491 Erasing and Winning

    题意: 给你一个n位整数,让你删掉d个数字,剩下的数字要尽量大. 分析: 用了vector数组模拟.如果当前要插入的数>vector数组里的最后一位数,就替换且d-- 代码: #include ...

  5. 黑科技——编写一个无法卸载的App

    之前经常听到朋友或者新闻媒体上报道说,有的朋友的android手机中病毒了,出现了软件无法卸载的情况,对于我这样一个从事android开发程序员来说,我还不是太相信(毕竟自己还是有点菜,哈哈).今天在 ...

  6. (四)Android中Context的理解与使用

    一.Context的作用 Context可用于访问全局资源. public class MainActivity extends Activity { private TextView tv; @Ov ...

  7. zendStudio安装Xdebug项目断点调试

    1,首先安装xdebug插件 传送门 2,配置php.ini文件如下: [XDebug] xdebug.profiler_append = xdebug.profiler_enable = xdebu ...

  8. BestCoder Round #75 1003 - King's Order

    国王演讲后士气大增,但此时战争还没有结束,国王时不时要下发命令. 由于国王的口吃并没有治愈,所以传令中可能出现:“让第三军-军-军,到前线去” 这样的命令.由于大洋国在军队中安插了间谍 , 战事紧急, ...

  9. C++中内存分配详解

    转载自51CTO.com           http://developer.51cto.com/art/201107/276154.htm 我们都知道,内存基本上分为静态存储区.堆区和栈区三大部分 ...

  10. Android Intent的花样启动

    刚开始看郭大神的<>,实现以下里面的一些例子.Intent的花样启动 显示Intent的使用. 实例化一个Intent,并且制定当前的activity和要跳转到的activity Inte ...