MySQL8 使用Like更新字段包含 \, 需要使用\\\\ 进行转义查询
无情
阅读:635
2021-03-31 12:24:07
评论:0
待变更数据记录集合:
需要将\f4 字段替换为e1
查询SQL语句:
1、查询符合条件的数据总数:
select pdf_path from ucas_file_info where ucas_file_info.pdf_path like '\\\\f4%';
2、批量替换\f4 替换为e1
update ucas_file_info set ucas_file_info.pdf_path = replace(ucas_file_info.pdf_path, '\\f4', 'e1') where ucas_file_info.pdf_path like '\\\\f4%';
声明
1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。