Notes: Mysql uses regular expressions to simply solve the URL backslash problem of HTTP

Sometimes we need to add a backslash to the front of the URL / of the mysql record, and we need to process the replacement operation in batches. At this time, we can use REPLACE (field, expression, replacement content); update
usage

update 表 set url=REPLACE(url,‘\/’,‘/’);

query usage

select REPLACE(url,‘\/’,‘/’) from 表 WHERE vod_id=1000

insert image description here

Guess you like

Origin blog.csdn.net/zhaohaiyuan123/article/details/128863755