Home  >  Article  >  Database  >  将电话号码中间的四位数字编成*号

将电话号码中间的四位数字编成*号

WBOY
WBOYOriginal
2016-06-07 15:58:501774browse

MySql API中有函数 : INSERT(str,pos,len,newstr) 返回字符串 str, 其子字符串起始于 pos 位置和长期被字符串 newstr取代的len 字符。 如果pos 超过字符串长度,则返回值为原始字符串。 假如len的长度大于其它字符串的长度,则从位置pos开始替换。若任何一个

MySql API中有函数 :

INSERT(str,pos,len,newstr)

返回字符串 str, 其子字符串起始于 pos 位置和长期被字符串 newstr取代的len 字符。 如果pos 超过字符串长度,则返回值为原始字符串。 假如len的长度大于其它字符串的长度,则从位置pos开始替换。若任何一个参数为null,则返回值为NULL。

mysql> SELECT INSERT('Quadratic', 3, 4, 'What');

-> 'QuWhattic

使用 Sql查询 SELECT INSERT('13555556226',5,4,'****') AS phoneNum

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn