SELECT A.BH,
SUM((SELECT SUM(B.SF) FROM TABLE.B WHERE B.SFRQ = 一月 AND B.BH = A.BH)) YIYUE,
SUM((SELECT SUM(B.SF) FROM TABLE.B WHERE B.SFRQ = 二月 AND B.BH = A.BH)) ERYUE,
..
SUM((SELECT SUM(B.SF) FROM TABLE.B WHERE B.BH = A.BH)) HEJI
FROM TABLE A
GROUP BY A.BH