日期:2014-05-18 浏览次数:20697 次
create function getStock2(@customerName char(30),@time datetime,@productName char(30))
returns int
as
begin
declare @Stock int;
select @Stock=cpxsb.数量
from cp,cpxsb,xss
where cp.产品编号=cpxsb.产品编号 and cpxsb.客户编号=xss.客户编号 and 客户名称=@customerName and 产品名称=@productName and 销售日期=@time
return @Stock
end
create function getStock2(@customerName char(30),@time datetime,@productName char(30))
returns int
as
begin
declare @Stock int;
select @Stock=cpxsb.数量
from cp,cpxsb,xss
where cp.产品编号=cpxsb.产品编号 and cpxsb.客户编号=xss.客户编号 and 客户名称=@customerName and 产品名称=@productName and 销售日期=year(@time)
return @Stock
end
------解决方案--------------------