Code:
insert
into t3
( id , name , avgval , c1 , c2 , c3 , c4 , c5 )
select id
, name
, AVG(value)
, ( select MIN(c1) from t2 where id = 1 )
, ( select MIN(c2) from t2 where id = 2 )
, ( select MIN(c3) from t2 where id = 3 )
, ( select MIN(c4) from t2 where id = 4 )
, ( select MIN(c5) from t2 where id = 5 )
from t2
group
by id
, name
if this is not what you want, then it is because you've done such a wonderful job hiding your real table and column names and explaining the situation
