select a,sum(b) as b2 from temp group by a into curs tmp select tmp brow
select a,c,sum(b) as b2 from temp group by a,c into curs tmp select tmp brow
select spbh,spmc,sccj,sum(jhsl+cksl) as sl from dall group by spbh,spmc