Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
abhiram_414
Starting Member
14 Posts |
Posted - 2008-08-22 : 02:34:25
|
| Hi, I have an application where I have to write a query to get the number of times a character is repeated in string or varchar. Can you please help me.. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-08-22 : 02:41:35
|
| you want a sql query? it will b like belowSELECT len(yourstring)-len(replace(yourstring,yourcharacter,'')) |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
|
abhiram_414
Starting Member
14 Posts |
Posted - 2008-08-22 : 03:16:43
|
| Thank you. |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-08-22 : 03:43:16
|
Jusst for clarifying, which of the two approaches did you want? E 12°55'05.25"N 56°04'39.16" |
 |
|
|
abhiram_414
Starting Member
14 Posts |
Posted - 2008-08-25 : 04:57:40
|
| The first thing that is SELECT len(yourstring)-len(replace(yourstring,yourcharacter,'')) Which Visakh16 has told. |
 |
|
|
|
|
|