Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
hi i ve column like email in that mano*****@gmail.com..
but i am trying to get mano*****@gmail.com...

i try like that but i am not getting proper ans

select substring(email,1,4)+('***') as emailid from hospital_review


please help regardig this issue
Posted
Updated 29-Jul-12 19:45pm
v2

select top 5 substring(email,1,4)+('***')+ substring(email,Charindex('@',email,1),LEN(email)-1) as emailid from hospital_review
SQL

 
Share this answer
 
Comments
Manohar_manu 30-Jul-12 1:50am    
thank u very much it s works
vinodkumarnie 31-Jan-13 5:39am    
nice one..
select substring('manoharas@gmail.com',1,4)+replicate('*',charindex('@','manoharas@gmail.com'))+('@gmail.com')

hope this will help you

thanks and regards
sarva
 
Share this answer
 
SUBSTRING(EmailID,0,CHARINDEX('@', EmailID,1))as EmailID
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900