create proc proc_grade(
@testname varchar(50),
@grade int output)
as
begin
select @grade=mingci from ( select row_number() over (order by score desc) as mingci ,score,testname from scoreinfo ) as a where a.testname = @testname
end
select row_number() over (order by score desc) as mingci ,score,testname from scoreinfo
declare @grade varchar(50)
exec proc_grade 'kdk', @grade output
print @grade
@testname varchar(50),
@grade int output)
as
begin
select @grade=mingci from ( select row_number() over (order by score desc) as mingci ,score,testname from scoreinfo ) as a where a.testname = @testname
end
select row_number() over (order by score desc) as mingci ,score,testname from scoreinfo
declare @grade varchar(50)
exec proc_grade 'kdk', @grade output
print @grade