select uEmail from table
[email protected]
[email protected]
[email protected]
如何让显示的Email带有星号
如
[email protected]
[email protected]
[email protected]
谢谢了
------解决方案--------------------
- SQL code
select uEmail=replace(uEmail,substring(uEmail,5,3),'***') from table
------解决方案--------------------
- SQL code
DECLARE @T TABLE (uEmail NVARCHAR(50))INSERT @T SELECT [email protected]'INSERT @T SELECT [email protected]'INSERT @T SELECT [email protected]'SELECT CASE WHEN CHARINDEX('@',uEmail)<5 THEN LEFT(uEmail,CHARINDEX('@',uEmail)-1) ELSE LEFT(uEmail,4) end+'***'+RIGHT(uEmail,CHARINDEX('@',REVERSE(uEmail))) AS uEmailFROM @T/*[email protected][email protected][email protected]*/
------解决方案--------------------
------解决方案--------------------