oracle-update
ORACLE UPDATE 语句语法与性能分析看法
作者:未知
ORACLE UPDATE 语句语法与性能分析的一点看法
为了方便起见,建立了以下简单模型,和构造了部分测试数据:
在某个业务受理子系统BSS中,
--客户资料表
create table customers
(
customer_id number(8) not null, -- 客户标示
city_name varchar2(10) not null, -- 所在城市
customer_type char(2) not null, -- 客户类型
...
)
create unique index PK_customers on customers (customer_id)
由于某些原因,客户所在城市这个信息并不什么准确,但是在
客户服务部的CRM子系统中,通过主动服务获取了部分客户20%的所在
城市等准确信息,于是你将该部分信息提取至一张临时表中:
create table tmp_cust_city
(
customer_id number(8) not null,
citye_name varchar2(10) not null,
customer_type char(2) not null
)
1) 最简单的形式
--经确认customers表中所有customer_id小于1000均为'北京'
--1000以内的均是公司走向全国之前的本城市的老客户:)
update customers
set city_name='北京'
where customer_id<1000
2) 两表(多表)关联update -- 仅在where字句中的连接
--这次提取的数据都是VIP,且包括新增的,所以顺便更新客户类别
update customers a -- 使用别名
set customer_type='01' --01 为vip,00为普通
where exists (select 1
from tmp_cust_city b
where b.customer_id=a.customer_id
)
3) 两表(多表)关联update -- 被修改值由另一个表运算而来
update customers a -- 使用别名
Oracle -Update 多表关联_IT/计算机_专业资料。一条 Update 更新语句是不能更新多张表的,除非使用触发器隐含更新。而表的 更新操作中,在很多情况下需要在表达式...
Oracle-更新-OPatch-工具版本-的方法-说明_计算机软件及应用_IT/计算机_专业资料。Oracle-教程Oracle 更新 OPatch 工具版本 的方法 说明Oracle 更新 OPatch 工具...
5) 关联 update 的一个特例以及性能再探讨 在 oracle 的 update 语句语法中,除了可以 update 表之外,也可以是视图, 所以有以下 1 个特例: update (select a...
oracle的update语句研究_IT/计算机_专业资料。Oracle 的 update 语句优化研究一、 update 语句的语法与原理 1. 语法单表:UPDATE 表名称 SET 列名称 = 新值 ...
oracle update语句的几点写法_计算机软件及应用_IT/计算机_专业资料。oracle update语句的几点写法 update两表关联的写法包括字查询 update t2 set parentid=(...
Oracle_Oracle之UPDATE 关键字NOWAIT的详解_IT/计算机_专业资料。Oracle 数据库Oracle 之 UPDATE 关键字 NOWAIT 的详解 1、FOR UPDATE 和 FOR UPDATE NOWAIT 的...
oracle_update_计算机软件及应用_IT/计算机_专业资料。oracle_update about psu & psrLinux(RHEL5)下 Oracle 10g 版本升级(10.2.0.1.0-10.2.0.5.0) (...
oracle更新语法_计算机软件及应用_IT/计算机_专业资料。: 1.一般语法 update tab set col = ... [where ...] =后可以有子查询,但是必须对于tab的每一列返...
5) 关联 update 的一个特例以及性能再探讨 在 oracle 的 update 语句语法中,除了可以 update 表之外,也可以是视图,所以有以下 1 个特例: update (select a....
5) 关联update的一个特例及性能再探讨 在oracle的update语句语法中,除了能update表之外,也能是视图,所以有以下1个特例: update (select a.city_name,b.city_...
热门文档