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