Click here to Skip to main content
15,916,432 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how to find the occurence of characters using sql server

please send the query for the above question.

Place chennai

output as n as repetition of 2.

i want the above output.

Thanks & Rgds,
Narasiman P
Posted
Comments
OriginalGriff 29-Jun-12 2:44am    
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.

Hi,

Here you go:
SQL
declare @string varchar(100)
select @string = 'sfdasadhfasjfdlsajflsadsadsdadsa'
SELECT LEN(@string) - LEN(REPLACE(@string, 'd', '')) AS D_Count


All the best
--Amit
 
Share this answer
 
Comments
AshishChaudha 29-Jun-12 4:55am    
my 5!
_Amy 29-Jun-12 4:56am    
Thank you Ashish.

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