要是时间是char型:
select sun(本月用量) from table 
where substr(时间,6,2)=‘‘07’’//Oracle
where substring(时间,6,2)=‘‘07’’//Sybase.sql Server
group by 表号;