如何精简此SQL文?高手请进!
select b.officeid,b.budgetno,b.budgetitem,
(select sum(yearbudget) from budgetinfor where budgetno like rtrim(b.budgetno)+'%' and officeid='8888')
as yearbudget,
(select sum(onebudget) from budgetinfor where budgetno like rtrim(b.budgetno)+'%' and officeid='8888')
as onebudget,
(select sum(twobudget) from budgetinfor where budgetno like rtrim(b.budgetno)+'%' and officeid='8888')
as twobudget,
(select sum(threebudget) from budgetinfor where budgetno like rtrim(b.budgetno)+'%' and officeid='8888')
as threebudget,
(select sum(fourbudget) from budgetinfor where budgetno like rtrim(b.budgetno)+'%' and officeid='8888')
as fourbudget,
(select sum(fivebudget) from budgetinfor where budgetno like rtrim(b.budgetno)+'%' and officeid='8888')
as fivebudget,
(select sum(sixbudget) from budgetinfor where budgetno like rtrim(b.budgetno)+'%' and officeid='8888')
as sixbudget
from budgetinfor b
join financesubject f
on f.subjectid=b.budgetno
where officeid='8888'
and f.lastsubject='0'