create function getY(@x int)return intas @ybegin 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;