参见英文答案 >
How do you count the number of occurrences of a certain substring in a SQL varchar?16个
我需要sql server中列值的空格数. @H_404_3@例如:
我需要sql server中列值的空格数. @H_404_3@例如:
column1 ------------ aaa bbbb - 1 space aaa bbb ccc - 2 space aaa bbb ccc ddd - 3 space@H_404_3@我需要像这样的空间数. @H_404_3@谢谢.
解决方法
SELECT LEN(column1)-LEN(REPLACE(column1,' ',''))