REPLACE(<str>, <from>, <to>) 命令详解

替换字符串中的所有匹配片段

命令语法

REPLACE(<str>, <from>, <to>)

替换字符串中的所有匹配片段

示例

$ SELECT REPLACE(email, '@old.com', '@new.com') FROM users;

REPLACE(<str>, <from>, <to>) 用法说明

REPLACE(<str>, <from>, <to>) 是「常用函数」分类下的常用命令,作用是:替换字符串中的所有匹配片段。

典型用法如下:SELECT REPLACE(email, '@old.com', '@new.com') FROM users;。你可以复制到终端直接运行,或查看下方同组的相关命令。

常见问题解答

REPLACE(<str>, <from>, <to>) 是什么?
REPLACE(<str>, <from>, <to>) 用于替换字符串中的所有匹配片段,属于「常用函数」相关命令。
REPLACE(<str>, <from>, <to>) 怎么用?
在终端执行 SELECT REPLACE(email, '@old.com', '@new.com') FROM users; 即可,具体参数请按实际环境调整。
还有哪些相关命令?
「常用函数」分类下还有 16 条相关命令,见下方「相关命令」。