SQL查找和替换字符串的一部分 [英] SQL Find & Replace part of a string
本文介绍了SQL查找和替换字符串的一部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试在字符串中找到某些文本"catid = 18",其中每个字符串都不同. 我以前在下面使用过此查询,除了它只有在您知道整个字符串的情况下才起作用.
I'm trying to find certain text "catid=18" in a string, where each string is different except for this. I've used this query below before, except it only seems to work if you know the entire string.
update TABLE_NAME
set FIELD_NAME = replace(FIELD_NAME, 'findthis', 'replacewiththis');
推荐答案
也许您需要:
update TABLE_NAME
set FIELD_NAME = 'goodvalue'
WHERE FIELD_NAME = 'badvalue';
这篇关于SQL查找和替换字符串的一部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文