我有一个mysql表,其中一列有一些特殊文本。我需要用新文本替换此文本。
data_table:
Col1 Col2 Col3
1 tc That is nice word.
2 tq nice question.
我需要用Col3中的漂亮表替换漂亮的单词。我怎么能改变它?
此致
答案 0 :(得分:1)
UPDATE MyTable SET Col3 = REPLACE(Col3 ,'nice','beautiful');
答案 1 :(得分:1)
使用mysql REPLACE(col,'old value','newvalue')
答案 2 :(得分:0)
选择= SELECT REPLACE(col3,'nice','beautiful') from table where col1 = '1'
更新= UPDATE table SET Col3 = REPLACE(Col3 ,'nice','beautiful')
恕我直言.. CMIW