mysql name(이름) masking
DELIMITER // CREATE DEFINER=`mcouponbo`@`%` FUNCTION `getMaskName`(`v_code` varchar(10)) RETURNS varchar(50) CHARSET utf8 BEGIN declare return_value varchar(50); SELECT CASE CHAR_LENGTH(v_code) WHEN 0 THEN '' WHEN 1 THEN '*' WHEN 2 THEN CONCAT('*', SUBSTRING(v_code, 2, 1)) ELSE CONCAT(SUBSTRING(v_code, 1, 1), REPEAT('*', CHAR_LENGTH(v_code) - 2), SUBSTRING(v_code, CHAR_LENGTH(v_code), 1)) END IN..