作者:洪爷不是我 | 来源:互联网 | 2023-10-12 08:40
篇首语:本文由编程笔记#小编为大家整理,主要介绍了在MySQL中用regex搜索并替换字段相关的知识,希望对你有一定的参考价值。Afteraproblemwith
篇首语:本文由编程笔记#小编为大家整理,主要介绍了在MySQL中用regex搜索并替换字段相关的知识,希望对你有一定的参考价值。
After a problem with row break in a text field I found this way of searching within a where clause in an SQL query. Can be used for selection or update / replace purposes of course.
SELECT * FROM 'table' WHERE `name` REGEXP '
'
UPDATE 'table' SET 'field' = replace(field,"findvalue", "reaplcevalue") WHERE REGEXP 'regexp search expression'