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 ('1292','1293','1294','1295','1296','1297','1298','1299','1300','1301','1302','1303','1304','1305','1306','1307','1308','1309','1310','1311','1312','1313','1314','1315','1316','1317','1318','1319','1320','1321','1322','1323','1324','1325','1326','1327','1328','1329','1330','1331','1332','1333','1536','1537','1867','1956','2302','2555','2762') AND `a`.`cate` = '3' GROUP BY `b`.`examid`