MySQL 替换手机号码中间4位为星号显示

select REPLACE(tel,SUBSTR(tel,4,4),‘****‘) tel from rwork_uinfo where comp_id = 3722

  查询结果:

  

原文地址:https://www.cnblogs.com/irobotzz/p/12311170.html

时间: 2024-08-03 21:06:17

MySQL 替换手机号码中间4位为星号显示的相关文章

利用正则表达式实现手机号码中间4位用星号(*)

利用正则表达式实现手机号码中间4位用星号(*) 如何在PHP脚本中利用正则表达式实现手机号码中间4位用星号(*),这是PHP程序员需要掌握的实例哟,很可能就在笔试中出现.如果你对代码如何实现感到迷茫,那就好好看这端源码吧: <?php //第一种方法: function hidtel($phone){ $IsWhat = preg_match('/(0[0-9]{2,3}[\-]?[2-9][0-9]{6,7}[\-]?[0-9]?)/i',$phone); //固定电话 if($IsWhat

验证电子邮件?手机号码?密码6-15位?验证输入网址?身份证号?邮编? 文件改名? 替换字符串部分单词?

/** *验证电子邮件?手机号码?密码6-15位?验证输入网址?身份证号?邮编? *邮箱正则: *"[\\w]@[\\w](.\\w+)+"; */ public class StringDemo8 { public static void main(String[] args) { String email = "[email protected]"; String emailRegex = "[\\w][email protected][a-zA-z0

mysql替换字段里数据内容部分字符串

mysql替换表的字段里面内容,如例子: mysql> select host,user from user  where user='testuser'; +-----------------------+----------+| host                  | user     |+-----------------------+----------+| localhost.localdomain | testuser | +-----------------------+-

替换身份证中的数字为星号(*******)代替

<?php //替换身份证中的数字为星号(*******)代替 function replace_id_numbers($id_number){ try{ if(!$id_number){ E('未能获取到身份证的信息!'); } $get_replace_str=substr($id_number,4,10); $a="**********"; return str_replace("$get_replace_str",$a,"$id_number

Mysql笔记之 -- replace()实现mysql 替换字符串

mysql 替换函数replace()实现mysql 替换字符串 mysql 替换字符串的实现方法: mysql中replace函数直接替换mysql数据库中某字段中的特定字符串,不再需要自己写函数去替换,用起来非常的方便. mysql 替换函数replace() UPDATE `table_name` SET `field_name` = replace (`field_name`,'from_str','to_str') WHERE `field_name` LIKE '%from_str%

mysql 替换字符串

mysql中replace函数直接替换mysql数据库中某字段中的特定字符串,不再需要自己写函数去替换,用起来非常的方便. mysql 替换函数replace() UPDATE table_name  SET field_name = REPLACE ( field_name , 'from_str', 'to_str' ); 说明: table_name —— 表的名字 field_name —— 字段名 from_str —— 需要替换的字符串 to_str —— 替换成的字符串 例如: m

Hive(2)-Hive的安装,使用Mysql替换derby,以及一丢丢基本的HQL

一. Hive下载 1. Hive官网地址 http://hive.apache.org/ 2. 文档查看地址 https://cwiki.apache.org/confluence/display/Hive/GettingStarted 3. 下载地址 http://archive.apache.org/dist/hive/ 4. github地址 https://github.com/apache/hive 5. 也可以使用我准备好的安装包 https://pan.baidu.com/s/1

MySql 替换某一个字段的值

update table set name = replace(name,'name_','') where name like 'name_%';--替换 replace(name,'name_','') 把name中出现'name_'的全部替换为'' update table set name = substr(name,6) where name like 'name_%'; --截取 mysql中的substr()函数 用法: substr(string string,num start

MySQL 替换部分电话号码为000

要做敏感信息剔除,要求又不能全换成同一个号码影响测试,想了几个方法,最终采用替换部分电话号码为000来做到敏感信息覆盖. mysql>update phone setb=replace(b,substring(b,4,3),'000'); 从第4个开始替换3个为000 mysql> select *from phone; +---+-------------+ | a | b           | +---+-------------+ | 1 | 18500025105 | | 2 | 1