【发布时间】:2021-12-25 10:37:56
【问题描述】:
我有 2 个表,在表 1 中,我有一个具有错误值的 clob 文件,我需要用另一个表中的正确值替换它。
表1
| column1 | column2 (clob) |
|---|---|
| 1234 | abc...N0001234... |
| 2345 | askdfa.. N0002434.... |
在上面的 table1 N000**** 不正确,现在我有 table2,其中我有正确的值(这不是 clob)
表2
| Column1 | column2 | column3 |
|---|---|---|
| 1234 | N0004567 | N0001234 |
| 2345 | N0002435 | N0002434 |
现在我尝试了类似下面的抛出错误
update table1
set column2 = replace (column2, select column3 from table2 where table1.column1 = table2.column1,
select column2 from table2 where table1.column1 = table2.column1)
where table1.column1 in (select column1 from table2 where table1.column1 = table2.column1);
但是 oracle 抛出了一个缺少表达式的错误。
有人可以帮帮我吗?
【问题讨论】: