delete s from score s,student x where s.xuehao=x.xuehao
declare @ta table (id int) insert into @ta select 1 insert into @ta select 2 insert into @ta select 3 insert into @ta select 4declare @tb table (id int) insert into @tb select 1 insert into @tb select 5 insert into @tb select 3delete a from @ta a,@tb b where a.id=b.idselect * from @ta 2 4
declare @score table (xuehao int) insert into @score select 1 insert into @score select 2 insert into @score select 3 insert into @score select 4declare @student table (xuehao int) insert into @student select 1 insert into @student select 5 insert into @student select 3delete a from @score a,@student b where a.xuehao=b.xuehaoselect * from @score 2 4
delete from score as s where xuehao in(select t.xuehao from student as t where s.xuehao=t.xuehao)
from score s,student x
where s.xuehao=x.xuehao
declare @ta table (id int)
insert into @ta select 1
insert into @ta select 2
insert into @ta select 3
insert into @ta select 4declare @tb table (id int)
insert into @tb select 1
insert into @tb select 5
insert into @tb select 3delete a from @ta a,@tb b where a.id=b.idselect * from @ta
2
4
insert into @score select 1
insert into @score select 2
insert into @score select 3
insert into @score select 4declare @student table (xuehao int)
insert into @student select 1
insert into @student select 5
insert into @student select 3delete a from @score a,@student b where a.xuehao=b.xuehaoselect * from @score
2
4
delete from score as s where xuehao in(select t.xuehao from student as t where s.xuehao=t.xuehao)