![](https://img-my.csdn.net/uploads/201303/01/1362132276_3810.jpg)
(1)这个是要irprot做出来的样式。
![](https://img-my.csdn.net/uploads/201303/01/1362132298_4830.jpg)
(2)
第(2)张图是我研究出的。在irprot上又不能改。
![](https://img-my.csdn.net/uploads/201303/01/1362132316_1496.jpg)
(3)这个是sql得到的数据。
select k.fattype fattype,k.FATMINITYPE fatminitype,count(accidentid) minicount from (
select v.accidentid accidentid,v.fatname fatminitype,tf.fatname fattype from
(select a.accidentid,a.FATTYPE FATTYPE,a.FATMINITYPE,b.fatname from elev_accident a,ELEV_FAULTTYPE b where
a.FATMINITYPE = b.fatid and a.isdel=0 and a.ACCIDENTSTATUS!=7 order by a.fattype,a.fatminitype ) v
,ELEV_FAULTTYPE tf where v.fattype = tf.fatid
) k group by k.fattype,k.FATMINITYPE order by fattype
这个sql