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 ('1334','1335','1336','1337','1338','1339','1340','1341','1342','1343','1344','1345','1346','1347','1348','1349','1350','1351','1352','1353','1354','1392','1597','1761','1962') AND `a`.`cate` = '1' GROUP BY `b`.`examid`