Sometime we have to count the occurrence of any specific string like :
Declare @Input NVarchar(Max)
Set @Input = 'A92GPGCatherineGeorgeB2VZ9VCARMENNAVARROARAUZ'
Here we have to count the occurrence.
so we can get this by using simple script :
Select (LEN(@Input) - LEN(REPLACE(@Input, '', ''))) / LEN('')
Thanks...
Declare @Input NVarchar(Max)
Set @Input = 'A92GPGCatherineGeorgeB2VZ9VCARMENNAVARROARAUZ'
Here we have to count the occurrence.
so we can get this by using simple script :
Select (LEN(@Input) - LEN(REPLACE(@Input, '', ''))) / LEN('')
Thanks...
No comments:
Post a Comment