Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我试图在一个字符串中找到某些文本“catid=18”,除了这个之外,每个字符串都是不同的。我以前在下面使用过这个查询,但它似乎只有在你知道整个字符串的情况下才有效。
update TABLE_NAME set FIELD_NAME = replace(FIELD_NAME, 'findthis', 'replacewiththis');
不确定这是否是您想要的。但1如果catid=any_num找到它会返回,0如果没有:
1
catid=any_num
0
select 'some_text catid=18 some_text' REGEXP 'catid=[0-9]+'
也许你需要:
update TABLE_NAME set FIELD_NAME = 'goodvalue' WHERE FIELD_NAME = 'badvalue';