sql连着function使用

create  function fun002(@thename varchar(20))
returns int
as
begin
declare @count int
select @count=count(@thename) from cm_ads

return @count-1
end

select dbo.fun002('ads_id')
 select   *,  dbo.fun002('ads_id') from  cm_ads  
原文地址:https://www.cnblogs.com/panjinzhao/p/5281179.html