select 
substring_index(substring_index(subject_set, ',', 2), ',', 1) as subject_id1,
count(*) as cnt
from comment_detail

where substring_index(substring_index(subject_set, ',', 2), ',', -1) = '1002'
group by substring_index(substring_index(subject_set, ',', 2), ',', 1)


把第一个数字串提出来
计算总数
限定必须第二个数字串为1002