select
case a.phone when null then null when '' then '' else concat_ws('****', substring(a.phone, 1, 3),substring(a.phone, 8, 4)) end as phone from visitor a
Mysql 若手机号字段不为空且不为null,隐藏手机号中间4位
最新推荐文章于 2023-04-04 11:39:25 发布
select
case a.phone when null then null when '' then '' else concat_ws('****', substring(a.phone, 1, 3),substring(a.phone, 8, 4)) end as phone from visitor a