select 时间,号,sum(得分) 得分 from tb1 group by 时间,号 order by 时间,号
create table ttt(时间 datetime,号 varchar(10),得分 int)insert ttt select '2000-01-01','01',10 union all select '2000-01-01','01',20 union all select '2000-02-01','01',30select 时间,号,sum(得分) as '得分' from ttt group by 时间,号
from 表
group by 时间,号
select '2000-01-01','01',10 union all
select '2000-01-01','01',20 union all
select '2000-02-01','01',30select 时间,号,sum(得分) as '得分'
from ttt
group by 时间,号