使用regexp更新mysql [英] mysql update with regexp
本文介绍了使用regexp更新mysql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想从表中删除某些内容1)
32)
121)
1000)
...格式为number
+ )
I want to remove something from my table 1)
32)
121)
1000)
... the format is number
+ )
我尝试了这段代码.
UPDATE articles SET
title= REPLACE(title,'\d)', '' )
WHERE title regexp "\d)*"
phpmyadmin
中什么都没发生,怎么写正确?谢谢.
Nothing happened in phpmyadmin
, how to write correct? Thanks.
推荐答案
您不能:Mysql不支持基于正则表达式的替换.
You can't: Mysql doesn't support regex-based replace.
有关解决方法,请参见此SO问题.
See this SO question for a work-around.
这篇关于使用regexp更新mysql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文