sql汇总查询的语句怎么写啊

2025-04-01 11:15:30
推荐回答(3个)
回答1:

select department 部门,id 工号,name 姓名,sum(money) 金额
from 表
where month(date)=4
group by department,id,name

回答2:

select id, name , count(money) from 表名 where MONTH(date) ='2' group by id ;

回答3:

select department,id,name,sum(money) from 表名 where dd>=#2013-4-01# and dd<#2013-5-01# group by department,id,name