日期:2014-05-16  浏览次数:20741 次

mysql统计字符串中‘#’号的个数(急,求助!)
有这样的一个字符串“1002#10131#145#154#10111#125#15#10121#15#105#”,请问如何统计出该字符串中‘#’的数目?


急,请大家帮帮忙!

------解决方案--------------------
select length(field1)-length(replace(field1,'#','')) from test;
------解决方案--------------------
学习了。。。学习了。。。学习了。。。
------解决方案--------------------
探讨
select length(field1)-length(replace(field1,'#','')) from test;

------解决方案--------------------
#1楼 正解。 .