这段代码
  use jxsk
go
if exists( select name from sysobjects
where name='d2'and type='p')
drop procedure d2
go
create proc d2
@name varchar(8)
as
select sn,tn,cn,score
from teacher,tc,student,sc,course
where teacher.tno=tc.tno and tc.cno=sc.cno and student.sno=sc.sno and sn=@name and  course.cno=sc.cno  and teacher.tno=tc.tnogo
exec d2 '钱尔'   
为什么和这段代码得到的结果一样
use jxsk
go
if exists( select name from sysobjects
where name='d2'and type='p')
drop procedure d2
go
create proc d2
@name varchar(8)
as
select sn,tn,cn,score
from teacher,tc,student,sc,course
where teacher.tno=tc.tno and tc.cno=sc.cno and student.sno=sc.sno and sn=@name 
and course.cno=(select sc.cno from student where sn=@name)go
exec d2 '钱尔' 
区别在这里  
select sn,tn,cn,score
from teacher,tc,student,sc,course
where teacher.tno=tc.tno and tc.cno=sc.cno and student.sno=sc.sno and sn=@name 
and course.cno=(select sc.cno from student where sn=@name)
和 select sn,tn,cn,score
from teacher,tc,student,sc,course
where teacher.tno=tc.tno and tc.cno=sc.cno and student.sno=sc.sno and sn=@name and  course.cno=sc.cno  and teacher.tno=tc.tno
望高手指点  谢谢
(因为没积分了 希望见谅)