MySQL 替换某字段内部分内容的UPDATE语句
时间:2024-01-22 17:45:49
要替换某一个字段中的部分内容,可以用update 语句:
UPDATE 表名 SET 字段名= REPLACE( 替换前的字段值, '替换前关键字', '替换后关键字' ) WHERE 字段名 REGEXP "替换前的字段值";
比如替换标题里面的产品价格就是用这个方法
UPDATE dede_archives SET title= REPLACE( title, 155, 170 );
UPDATE dede_archives SET title= REPLACE( title, 180, 230 );
UPDATE dede_archives SET title= REPLACE( title, 270, 350 );
UPDATE dede_archives SET title= REPLACE( title, 210, 170 );
UPDATE dede_archives SET title= REPLACE( title, 155, 170 );
标签:替换,UPDATE语句
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
web前端开发也需要日志
2024-04-18 10:04:05
asp fso删除非空目录的例子
2008-11-26 20:03:00
python实现Nao机器人的单目测距
2021-04-09 16:37:10
web.py获取上传文件名的正确方法
2021-01-22 16:00:06
js,jquery滚动/跳转页面到指定位置的实现思路
2024-04-10 16:19:54
SQL Server 2005作业设置定时任务
2024-01-27 13:02:59
![](https://img.aspxhome.com/file/2023/9/88229_0s.png)
Sqlserver事务备份和还原的实例代码(必看)
2024-01-23 18:44:14
Python3如何使用tabulate打印数据
2021-04-17 15:09:26
![](https://img.aspxhome.com/file/2023/7/124137_0s.png)
Python的内置数据类型中的数字
2023-12-29 19:36:37
![](https://img.aspxhome.com/file/2023/7/114517_0s.png)
详解mysql数据去重的三种方式
2024-01-22 03:06:35
![](https://img.aspxhome.com/file/2023/2/69762_0s.png)
CVE-2020-15148漏洞分析
2023-06-13 13:41:18
![](https://img.aspxhome.com/file/2023/3/55513_0s.jpg)
在Spring中用select last_insert_id()时遇到问题
2009-05-24 19:50:00
python实现无边框进度条的实例代码
2023-07-23 05:22:59
![](https://img.aspxhome.com/file/2023/5/81815_0s.png)
Python实现爆破ZIP文件(支持纯数字,数字+字母,密码本)
2021-09-01 22:30:12
![](https://img.aspxhome.com/file/2023/5/135245_0s.png)
python 模拟网站登录——滑块验证码的识别
2023-04-17 16:16:29
![](https://img.aspxhome.com/file/2023/8/107798_0s.png)
vue开发中关于axios的封装过程
2024-04-30 10:40:24
python安装pil库方法及代码
2021-10-22 16:55:24
![](https://img.aspxhome.com/file/2023/6/133356_0s.png)
python读写修改Excel之xlrd&xlwt&xlutils
2022-04-03 16:35:43
![](https://img.aspxhome.com/file/2023/9/94149_0s.jpg)
pytorch实现好莱坞明星识别的示例代码
2022-11-28 14:26:47
![](https://img.aspxhome.com/file/2023/7/96957_0s.jpg)
django 环境变量配置过程详解
2021-11-19 03:07:52
![](https://img.aspxhome.com/file/2023/1/134381_0s.png)