SELECT tel AS 脱敏前电话号码,CONCAT(LEFT(tel,3), '****',RIGHT(tel,4) ) AS 脱敏后电话号码 FROM t_s_user
-- 身份证号码脱敏sql: SELECT idcard AS 未脱敏身份证, CONCAT(LEFT(idcard,3), '****' ,RIGHT(idcard,4)) AS 脱敏后身份证号 FROM t_s_user