以后再来整理. -- 查询一个学校的报修单数 SELECT s.id AS schoolId , -- 学校ID COUNT(i.id) as cntId, -- 报修单数 IFNULL(t1.nohandlecnt,0) AS nohandlecnt, IFNULL(t2.overcnt,0) AS overcnt, ROUND(overcnt * 100 /COUNT(i.id),1) AS okRate FROM `t_issue` i LEFT JOIN ( -- 完成报修单数 SELE…