if exists(select *from sysobjects where name='p_stu')
drop procedure p_stu
go
create procedure p_stu
@num int
as
print '参加'+covert(varchar(5),@num)+'门课考试的学生姓名和学号;'select 姓名=(select MName from Menber where Mid=score.Mid), 学号=Mid from score group by Mid having count(*)=@num
drop procedure p_stu
go
create procedure p_stu
@num int
as
print '参加'+covert(varchar(5),@num)+'门课考试的学生姓名和学号;'select 姓名=(select MName from Menber where Mid=score.Mid), 学号=Mid from score group by Mid having count(*)=@num
drop procedure p_stu
go
create procedure p_stu
@num int
as
print '参加'+convert(varchar(5),@num)+'门课考试的学生姓名和学号;'
select 姓名=(select MName from Menber where Mid=score.Mid), 学号=Mid from score group by Mid having count(*)=@num
if exists(select *from sysobjects where name='p_stu')
drop procedure p_stu
go
create procedure p_stu
@num int
as
print '参加'+convert(varchar(5),@num)+'门课考试的学生姓名和学号;'
SELECT m.MName AS 姓名,学号=m.学号
FROM Menber AS m
INNER JOIN score AS s ON m.Mid=s.Mid
GROUP BY m.MID,m.MName
HAVING COUNT(*)=@num
if exists(select *from sysobjects where name='p_stu')
drop procedure p_stu
go
create procedure p_stu
@num int
as
print '参加'+convert(varchar(5),@num)+'门课考试的学生姓名和学号;' --少了一个n啊
select 姓名=(select MName from Menber where Mid=score.Mid), 学号=Mid from score group by Mid having count(*)=@num
if exists(select *from sysobjects where name='p_stu')
drop procedure p_stu
go
create procedure p_stu
@num int
as
print '参加'+convert(varchar(5),@num)+'门课考试的学生姓名和学号;' --convert少了一个n啊
select 姓名=(select MName from Menber where Mid=score.Mid), 学号=Mid from score group by Mid having count(*)=@num
go--最后加上go
drop procedure p_stu
go
create procedure p_stu
@num int
as
print '参加'+convert(varchar(5),@num)+'门课考试的学生姓名和学号;' --convert少了一个n啊
select 姓名=(select MName from Menber where Mid=score.Mid), 学号=Mid from score group by Mid having count(*)=@num
go--最后加上go