insert into sc
select sid,'03',score from
(select '03',avg(score) score from sc s1 where cid='03')s2
cross join (select distinct sid from sc s3
where not exists (select 1 from sc s4 where s4.cid='03' and s3.sid=s4.sid))s5
on 1=1
insert into sc
select sid,'03',score from
(select '03',avg(score) score from sc s1 where cid='03')s2
cross join (select distinct sid from sc s3
where not exists (select 1 from sc s4 where s4.cid='03' and s3.sid=s4.sid))s5
on 1=1