--20、PUE超标率 ---地市 select city_name, count(*) as pue_total, sum(case when pue>1.5 then 1 else 0 end) as pue_over, sum(case when pue>1.5 then 1 else 0 end)/count(*)::numeric as pue_over_rate from sqmdb_cost.pue_top group by city_name ---网格 select city_name, area_name, count(*) as pue_total, sum(case when pue>1.5 then 1 else 0 end) as pue_over, sum(case when pue>1.5 then 1 else 0 end)/count(*)::numeric as pue_over_rate from sqmdb_cost.pue_top group by city_name,area_name