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 ('1275','1356','1357','1358','1359','1360','1361','1362','1363','1364','1365','1366','1367','1368','1369','1370','1371','1372','1373','1374','1375','1376','1377','1378','1379','1380','1381','1382','1383','1384','1385','1386','1387','1388','1389','1390','1391','1604','1626','1878','1957','2303','2358','2554','2761') AND `a`.`cate` = '1' GROUP BY `b`.`examid`