sql - 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');
如何更新它
解决方案
假设所有字符串都具有相同的长度,并且您总是必须将第 6 个字符编辑为“2”,这可能就足够了:
update gngrb.prfile
set prno = substr(prno, 1, 5) || '2' || substr(prno, 7)
where ...
推荐阅读
- javascript - 如何在 NodeJs 中重建 canvas.toBlob() 返回的 PNG
- firebase - 如何在 Firebase 中安全地存储 OAuth 2.0 凭据?
- javascript - 如何计算篮子 Vuejs Vuex 的总价
- django - 在两个条件下从 Django 数据库中过滤元素
- flutter - MediaQuery.of() called with a context that does not contain a MediaQuery. How to fix this dart code?
- flutter - Wrong Flutter 错误 Convert image ImagePicker type File to base64, Wrong Encoded
- javascript - Grid.js 高级表格插件 - 未捕获的类型错误:无法解析模块说明符“gridjs”
- javascript - Ionic iOS 键盘显示问题
- java - 如何在 Java 中计算 KeyPairGenerator 的键大小?
- javascript - Bigcommerce 自定义 js 模块不适用于本地主机