读书人

*请问一个函数使用有关问题*

发布时间: 2012-01-30 21:15:58 作者: rapoo

**********************请教一个函数使用问题********************
select DepotGoods.id ,
dbo.GetSellCount(DEpotGoods.Goodsid ,1, '03 31 2007 10:50PM ', '03 31 2007 10:50PM ') as SellAmount
from DepotGoods
inner join Goods on Goods.id = DepotGoods.GoodsID
where 1=1
and
(select typeid from Goods g where g.id = DepotGoods.goodsid)=1
and SellAmount > =1 and SellAmount <=1 and DEpotGoods.Amount > =1 and DEpotGoods.Amount <=1

上面的语句为什么提示
列名 'SellAmount ' 无效。

谢谢!!!!

[解决办法]
select
DepotGoods.id ,
dbo.GetSellCount(DEpotGoods.Goodsid ,1, '03 31 2007 10:50PM ', '03 31 2007 10:50PM ') as SellAmount
from DepotGoods
inner join Goods on Goods.id = DepotGoods.GoodsID
where 1=1
and (select typeid from Goods g where g.id = DepotGoods.goodsid)=1
and dbo.GetSellCount(DEpotGoods.Goodsid ,1, '03 31 2007 10:50PM ', '03 31 2007 10:50PM ') > =1
and dbo.GetSellCount(DEpotGoods.Goodsid ,1, '03 31 2007 10:50PM ', '03 31 2007 10:50PM ') <=1
and DEpotGoods.Amount > =1
and DEpotGoods.Amount <=1

[解决办法]
这么快

读书人网 >SQL Server

热点推荐