UPDATE bcn_addr_maint c SET
(
addr_type,
build_code,
addr1,
addr2,
addr3,
addr4,
addr5,
addr_code,
floor,
flat_rm,
region
)
=
(
SELECT
addr_type,
build_code,
addr1,
addr2,
addr3,
addr4,
addr5,
addr_code,
floor,
flat_rm,
region
FROM bc_cus_addr b
WHERE a.pps=b.pps AND a.addr_type=b.addr_type and a.circuit_no is null and a.line_no is null
)
;以上table数据的update那样写吗??
(
addr_type,
build_code,
addr1,
addr2,
addr3,
addr4,
addr5,
addr_code,
floor,
flat_rm,
region
)
=
(
SELECT
addr_type,
build_code,
addr1,
addr2,
addr3,
addr4,
addr5,
addr_code,
floor,
flat_rm,
region
FROM bc_cus_addr b
WHERE a.pps=b.pps AND a.addr_type=b.addr_type and a.circuit_no is null and a.line_no is null
)
;以上table数据的update那样写吗??
解决方案 »
- 用户之间如何赋予对象的访问权限 啊?
- 创建存储
- 帖了一年都无人能解决的问题-wm_sys.wm_concat 排序问题
- 初学者问题:启动数据库,startup 和 startup open 的区别?
- 服务器限制端口了,只有80,1521开放,程序可以连接到ORALCE,但是我PL/DEV,却连接不了ORALCE,提示没有监听器。
- 给点建表的建议。在线等待......
- 请问各位高手如何实现将.doc文件存入oracle中,例如用什么数据类型,应注意些什么等等。
- 给高分!在线紧急求救!
- 初次安装OWB失败,重金请高手解答,先谢谢!
- Orcale安装出现了问题
- 请教一条Sql语句
- WINDOWS7 能不能安装 oracle BI publisher
UPDATE a SET
(c1,c2,c3
) =
(SELECT b1,b2,b3 FROM b where......
) WHERE ......;好象少写了最外层的where 条件
update table set (c1,c2)=(value1,value2)...
网上搜索得到的结果是要update那里要多一个clause:WHERE exists (select 1 from FROM bc_cus_addr b a.pps=b.pps AND a.addr_type=b.addr_type and a.circuit_no is null and a.line_no is null)我觉得应该是要多加一个clause。你们觉得呢?
create table resource_tab(
BeginResId number,
EndResId number,
count number,
price number
);insert into resource_tab values(10001,10005,5,100);
insert into resource_tab values(10007,10012,6,200); update resource_tab rt
set (rt.beginresid, rt.endresid, rt.count) =
(select rt1.beginresid + 1, rt1.endresid + 1,rt1.count
from resource_tab rt1
where rt1.beginresid = rt.beginresid
and rt1.endresid = rt.endresid)
UPDATE bcn_addr_maint a SET
(
addr_type,
build_code,
addr1,
addr2,
addr3,
addr4,
addr5,
addr_code,
floor,
flat_rm,
region
)
=
(
SELECT
addr_type,
build_code,
addr1,
addr2,
addr3,
addr4,
addr5,
addr_code,
floor,
flat_rm,
region
FROM bc_cus_addr b
WHERE a.pps=b.pps AND a.addr_type=b.addr_type and a.circuit_no is null and a.line_no is null
) where exists(select 1 FROM bc_cus_addr c
WHERE a.pps=c.pps AND a.addr_type=c.addr_type and a.circuit_no is null and a.line_no is null);