SQL统计一个字段里某个特定字符的个数

select sum(length(couponrecordid)-length(replace(couponrecordid,',',''))) from t_order where paytype=2 and (studentstate!=4 and coachstate!=4)

and couponrecordid  like '%,%';


其中:couponrecordid 字段中的值:

12,566

67,45,88,99

134,7,8,9,678   



posted @ 2016-01-06 11:15  陆陆通通  阅读(912)  评论(0编辑  收藏  举报