首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

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

2012-01-30 
**********************请教一个函数使用问题********************selectDepotGoods.id,dbo.GetSellCount(

**********************请教一个函数使用问题********************
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

[解决办法]
这么快

热点排行