现在我要将select type_,count(*) as cnt from itom_device group by type_做张报表,现在是显示两个字段的报表一个是类型以个是数量。而其中的type和另一张表关联,我之前是给type加个数据集。可是只循环显示第一条。。。请帮忙看下如何决绝。。。非常感谢。
资产百分率类统计,统计处于某种状态的资产(如在用资产)占全部资产的比率;
select a.data_name,a.status_,a.cnt, round(a.cnt/b.cnt*100,2) from
(select data_name,status_,count(*) as cnt from itom_device,base_datadict where dict_id=type_ group by data_name,status_) a,
(select data_name,count(*) as cnt from itom_device,base_datadict where dict_id=type_ group by data_name) b
where a.data_name=b.data_name