mysql的REPLACE
时间: 2023-10-12 12:05:15 浏览: 81
SQL SERVER使用REPLACE将某一列字段中的某个值替换为其他的值
在MySQL中,REPLACE是一个用于替换字符串的函数。它接受三个参数:原字符串、要替换的字符串和要替换成的字符串。它会在原字符串中找到要替换的字符串,并将其替换为指定的字符串。举个例子,在你提供的引用中的SQL语句 SELECT s_id, s_name, REPLACE(phone,'136','158') FROM student;,这个语句的作用是查询student表中的s_id、s_name和phone字段,并将phone字段中的"136"替换为"158"。这样,查询结果中的phone字段将显示替换后的值。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [MySQL的Replace用法详解](https://blog.csdn.net/xixiqiuqiu/article/details/122806694)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [[Mysql] REPLACE函数](https://blog.csdn.net/Hudas/article/details/123700010)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文