Oracle之with as和update用法

Posted 太白的技术博客

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Oracle之with as和update用法相关的知识,希望对你有一定的参考价值。

许久不用,又忘了,做个记录

update test b set b.code=(
with t as
(select t.id,code||‘_‘||row_number() over(partition by code order by id) code
from test t)
select a.code from t a where a.ID=b.ID
);

很多金融统计中,语句相当复杂。有可能会update的时候索引使用不上,看执行计划走不了hash join,数据量大的时候,适合于创建临时表。






以上是关于Oracle之with as和update用法的主要内容,如果未能解决你的问题,请参考以下文章

Oracle中with as用法

Oracle中with as的用法

Sql server with as update用法

ORACLE WITH AS 用法

ORACLE WITH AS 用法

关于oracle with as用法