//sum(电费)---汇总电费 //count(电费) --汇总月份 select sum(电费)/count(电费) as a from 表with (nolock) where new_year = 年份 and 电费>0