第一行报错不知道怎么办了
create function f_Profit(@lb char(10))
RETURNS @ProfitTable table(
goodid char(10),
sumprofit int)
as
begin
insert into @ProfitTable
select a.goodid,SUM(salenum*(saleprice-goodprice)) as sumprofit
from a join b on a.goodid=b.goodid
where a.goodid in(select goodid from a where goodlb=@lb)
group by a.goodid
order by sumprofit desc
end
return
GO
麻烦大佬们帮我看看怎么改