SELECT a.*, count(b.id) as num FROM `tcyun_exam` `a` INNER JOIN `tcyun_exam_question` `b` ON `a`.`id`=`b`.`examid` WHERE `a`.`id` IN ('27','46','47','48','49','50','51','55','56','57','58','59','60','61','62','320','321','338','393','415','416','417','418','419','420','421','422','424','426','427','428','429','431','433','452','456','461','469','474','785','1189','1190','1191','1192','1193','1234','1587','1590','1591','1617','1634','1946','1952','2087','2088','2089','2090','2091','2092','2093','2094','2096','2099','2100','2101','2274') AND `a`.`cate` = '1' GROUP BY `b`.`examid`