create table #(id varchar(50),pr int)
insert into #(id,pr)
select '11105010001059',10
union all select '11105010001060',20
union all select '11105010001060',30
union all select '22205010001060',10
union all select '32205010001060',15
select sum(pr) as pr from #
group by left(id,1)
drop table #