数据库n!怎么算啊?

来源:百度知道 编辑:UC知道 时间:2024/06/15 19:13:42
这是数据库的题

--给你简单写了一个,要改成存储过程也可以的.
declare @n INT
declare @i int,@temp int
set @n=10 --这里是要求的N,可以修改
set @i=1
set @temp=1
while @i<=@n
begin
select @temp=@temp*@i
select @i=@i+1
end
select @temp --输出