select sum(MR_Money) from T_MaintainRecord group by MR_Department
select sum(MR_Money),MR_Department from T_MaintainRecord group by MR_Department
select MR_Department,sum(MR_Money) from T_MaintainRecord group by MR_Department
加个时间.按时间查询费用总和.MR_ReturnDate时间.
select MR_Department,sum(MR_Money) from T_MaintainRecord group by MR_Department
分组查询只能有一个条件,按时间或按部门查询 select MR_Department,sum(MR_Money) from T_MaintainRecord group by MR_Department or select MR_ReturnDate,sum(MR_Money) from T_MaintainRecord group by MR_ReturnDate
select MR_Department,sum(MR_Money),MR_ReturnDate from T_MaintainRecord where MR_ReturnDate > 时间起 and MR_ReturnDate < 时间止 group by MR_Department,MR_ReturnDate
group by MR_Department
select MR_Department,sum(MR_Money) from T_MaintainRecord group by MR_Department
or
select MR_ReturnDate,sum(MR_Money) from T_MaintainRecord group by MR_ReturnDate