update tab_a
set
col1=(select ...)
col2=(select ...)
col3=(select ...)
where ...
set
col1=(select ...)
col2=(select ...)
col3=(select ...)
where ...
解决方案 »
- ORA-01033: ORACLE initialization or shutdown in progress
- 请教oracle一个自定义聚合函数 aggregate function 的问题,十分感谢!
- 将varchar合并后,如果数据量太大,想用clob,该怎么处理?
- 问个小问题,请教
- 在ORACLE中如何使用扩展ASCII码?
- ORA-01122: 数据库文件 1 验证失败
- oracle8.1.7比oracle8.1.6到底有哪些方面的改进?
- bzszp的方法如何使用,新手分多(100%结帖),8小时在线!
- 谁能提供oracle10g 的补下
- ORA-01100
- CrystalReport的数据导出有什么注意事项么?点击报表的导出按钮,没有反应
- 为什么存储过程里不能用create和drop语句
update table1 a set column=... where 条件1 and exists (select '1' from table2 b where a表的三个字段=b表的三个字段)
update tab_a
set ...
where
col1=(select ...from a where ..)
col2=(select ...from a where..)
col3=(select ...from a where..)from来自同一表的三个字段,同一条件
update tab_a
set ...
where col1 = (select col1 from tab_b) and
col2 = (select col2 from tab_b) and
col3 = (select col3 from tab_b);
set
col1=(select ...)
col2=(select ...)
col3=(select ...)
where ...
col2=(select ...from a where..)
col3=(select ...from a where..)
一定要唯一,不然要改成以下:
col1 in (select ...from a where ..)
col2 in (select ...from a where..)
col3 in (select ...from a where..)语句变得复杂了,为何不用游标,真不明??
update tab_a set
(filed1,field2,field3)=(select fieled1,field2,field3 select tab_b where ...) where ...;
set ...
where col1||col2||col3=(select col1||col2||col3 from tab_b where tab_a.id=tab_b.id)
必须要转换成字符型的吧,不过已经很简单了。谢谢!
col1=null col2='200' col3=null 和
col1='200' col2=null col3=null 等效吧
set ...
where nvl(col1,1)||nvl(col2,2)||nvl(col3,3)=(select nvl(col1,1)||nvl(col2,2)||nvl(col3,3) from tab_b where tab_a.id=tab_b.id)