您的位置:首页 > 其它

一个简单的存储过程

2007-10-19 19:10 211 查看
create procedure Sstu @dept varchar(20),
@avg_age smallint output,@max_age smallint output
AS
select * from Student where
select @avg_age=avg(sage) from Student where
select @max_age=max(sage) from Student where

declare @avg_age smallint,@max_age smallint
exec Sstu 'cs',@avg_age output,@max_age output
select @avg_age as avg,@max_age as max

运行结果:



内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: