急求数据库的一份答案

2024-11-07 13:39:23
推荐回答(1个)
回答1:

create function getY(@x int)
return int
as @y
begin
case
when @x<0 then
set @y=@x+2
when @x<5 then
set @y=4*x
else
set @y=5*x-4
end;
return @y;
end;