利用replace 和 substring函数实现,更新product_img_url表的image_url 是 http:开头的,批量替换成https:
update product_img_url set image_url = replace(image_url,'http:','https:') where substring(image_url,1,5)='http:'
本文介绍了一个SQL查询示例,用于批量更新数据库中product_img_url表的image_url字段,将所有以'http:'开头的URL替换为'https:'. 这种操作在确保网站安全性,将HTTP升级为HTTPS的过程中非常常见。
利用replace 和 substring函数实现,更新product_img_url表的image_url 是 http:开头的,批量替换成https:
update product_img_url set image_url = replace(image_url,'http:','https:') where substring(image_url,1,5)='http:'
568
512

被折叠的 条评论
为什么被折叠?