这段代码
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
望高手指点 谢谢
(因为没积分了 希望见谅)
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
望高手指点 谢谢
(因为没积分了 希望见谅)
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货