1 SELECT c.*, sum(t.num) as num, b.num as total FROM np_wenjuan_choice as c 2 left join ( 3 select content, count(id) as num 4 from np_wenjuan_answer as a 5 where question_id = 8 6 group by content 7 ) as t on t.content like concat('%',c.index,'%') 8 left join ( 9 select question_id, count(id) as num 10 from np_wenjuan_answer11 where question_id = 812 group by question_id13 ) as b on b.question_id = c.question_id14 where c.question_id = 815 group by title16 order by c.index