首页 > 解决方案 > Oracle SQL 多更新

问题描述

请编辑公关号码

L3970076 to L3970276, 
L3970077 to L3970277, 
L3970078 to L3970278, 
L3970080 to L3970280, 
L3970082 to L3970282, 
L3970083 to L3970283, 
L3970085 to L3970285

SELECT * FROM GNGRB.PRFILE WHERE PRNO IN ('L3970076', 'L3970077', 'L3970078', 'L3970080', 'L3970082', 'L3970083', 'L3970085');

如何更新它

标签: sqloraclesql-update

解决方案


假设所有字符串都具有相同的长度,并且您总是必须将第 6 个字符编辑为“2”,这可能就足够了:

update gngrb.prfile
set prno = substr(prno, 1, 5) || '2' || substr(prno, 7)
where ...

推荐阅读