获取存储过程的总价值

时间:2013-01-09 07:43:07

标签: sql-server-2008

在执行此查询时,我总是得到让步结果为'0',完全我得到了2万个客户数据,但是对于所有客户我只得到让步值为'0',我在这些查询中做了什么错误?

- 4.特许经营权其他预购

if (select count(*) FROM tbl_OrderFoodLog where OrderLog_ID in
    (select OrderLog_ID from  #MemberOrderLog where Member_MailId=@EmailId))>0

if (select count(*) from  #CustTrans where  OrderLog_IsFoodOrder='Y')>0
begin
    select  @Concession=(select SUM( FoodLog_Total) FROM tbl_OrderFoodLog where OrderLog_ID --in ( select OrderLog_ID from  #MemberOrderLog where Member_MailId=@EmailId))/
--(select -COUNT(*) from  #MemberOrderLog where Member_MailId=@EmailId) 
    select @FoodAmount=cast(SUM( FoodLog_Total) as float) FROM tbl_OrderFoodLog where OrderLog_ID in ( select OrderLog_ID from  #CustTrans where  OrderLog_IsFoodOrder='Y')
    select  @Concession=(@FoodAmount)/@Frequency
            end
        else
            begin
                select @Concession=0.00
            end

先谢谢

0 个答案:

没有答案