在更新中使用通配符? [英] Using a wildcard in an update?

查看:108
本文介绍了在更新中使用通配符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想浏览一张表,并将'notify4-N'的所有实例更改为'notify5-N',其中N是1到9之间的数字.有没有办法在SQL中做到这一点?使用perl会很容易,但是我不确定客户的服务器上是否还安装了perl.

I want to go through a table, and change all instances of 'notify4-N' to 'notify5-N', where N is a number from 1-9. Is there a way to do that in SQL? It would be easy in perl, but I'm not sure the customer even has perl on his servers.

推荐答案

您可能正在寻找 REGEXP_REPLACE REGEXP_LIKE与更新一起使用.

You are probably looking for the REGEXP_REPLACE and REGEXP_LIKE function in conjunction with an update.

 update sometable set somecol = REGEXP_REPLACE(somecol, ...) where REGEXP_LIKE(somecol, ...) 

这篇关于在更新中使用通配符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆