这里提取指定符串"A"在字段中的出现次数SQL为:
select len(keyword)-len(replace(keyword, 'A', ' ')) from 表
原理:用replace函数将要查找的字符替换为空字符,将替换之间的字符串长度-替换后字符串长度
这里提取指定符串"A"在字段中的出现次数SQL为:
select len(keyword)-len(replace(keyword, 'A', ' ')) from 表
原理:用replace函数将要查找的字符替换为空字符,将替换之间的字符串长度-替换后字符串长度
转载于:https://www.cnblogs.com/liwuyi/p/5525793.html