日期:2014-05-18  浏览次数:20468 次

问个问题
create   function   getCountChild(@PFID   int)    
returns   integer
as
return   (select   COUNT(*)   from   forum_t   where   iPFID=@PFID)

说我return这儿有语法错误,我不知道错哪儿呀,应该怎么写呀

------解决方案--------------------
create function getCountChild(@PFID int)
returns int
as
begin

return(select COUNT(*) from forum_t where iPFID=@PFID)

end
------解决方案--------------------
create function getCountChild(@PFID int)
returns integer
as
begin
declare @i integer
select @i=COUNT(*) from forum_t where iPFID=@PFID
return @i
end