关于自定义函数的创建和调用
Create function AvgResult(@scode varchar(10)) Returns real As Begin Declare @avg real set @avg='1.2'; Return @avg End
调用方法:
select dbo.AvgResult('s0002') as result
Create function AvgResult(@scode varchar(10)) Returns real As Begin Declare @avg real set @avg='1.2'; Return @avg End
调用方法:
select dbo.AvgResult('s0002') as result