不知道怎么改了
麻烦帮我看看
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
稍微改动了下,想在什么平台上运行
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
go
CREATE FUNCTION sp_name([func_parameter[,...]])
RETURNS type
routine_body