时间:2021-07-01 10:21:17 帮助过:12人阅读
ALTER function [dbo].[getStaLike](@sex NVARCHAR,@active NVARCHAR,@age decimal,@HEIGHT decimal,@WEIGHT decimal)
returns NVARCHAR(64)
as
begin
return(
select top 1 s.id from standard s where sex=@sex and active= @active order by abs(AGE-@age), abs(HEIGHT-@HEIGHT), abs(WEIGHT-@WEIGHT)
)
end
sqlserver自定义函数
标签:pos arc 自定义函数 get alike nvarchar varchar begin 定义函数