Number of times a particular character appears in a string

后端 未结 10 2427
终归单人心
终归单人心 2020-11-27 16:41

Is there MS SQL Server function that counts the number of times a particular character appears in a string?

10条回答
  •  旧时难觅i
    2020-11-27 16:46

    Use this function begining from SQL SERVER 2016

    Select Count(value) From STRING_SPLIT('AAA AAA AAA',' ');
    
    -- Output : 3 
    

    When This function used with count function it gives you how many character exists in string

提交回复
热议问题