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_num0
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';