Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

SQL Server - Count number of times a specific character appears in a string

declare @myvar varchar(20)
set @myvar = 'Hello World'

select len(@myvar) - len(replace(@myvar,'o',''))
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #SQL #Server #Count #number #times #specific #character #appears #string
ADD COMMENT
Topic
Name
3+5 =