try:
insert into C
(
select
AF1,AF2,AVG(AF3),
(select BF3 from B where BF1=AF1 AND BF2=AF2) from A group by AF1,AF2
)