declare @ta table(cid0 int,fid0 int)
insert into @ta(cid0,fid0)
(select fid,COUNT(fid) as co from tt where fid>0
group by fid)
group by的应用。。
insert into 表1(字段a,字段b,字段c)
(select 字段aa,字段bb,字段cc from 表2 )
=================================================另
insert into moon(dormno,average) select dormno, avg(average) as average from week group by dormno