题解 | sql238
将id=5以及emp_no=10001的行数据替换成id=5以及emp_no=10005
https://www.nowcoder.com/practice/2bec4d94f525458ca3d0ebf3bc8cd240
update titles_test set emp_no=replace(emp_no,10001,10005) where id=5
REPLACE(str,old_string,new_string); SQL
REPLACE()函数有三个参数,它将string中的old_string替换为new_string字符串。
注意: 有一个也叫作REPLACE的语句用于插入或更新数据。所以不要将
REPLACE语句与这里的REPLACE字符串函数混淆。
//更多请阅读:https://www.yiibai.com/mysql/string-replace-function.html
