sql server 2008 聚合函数sum增加条件符合则显示该怎么完成,急急急!
代码写法selectv1.FCustIDasCustID,t2.Name,Sum(Round(.....*(IsNull(....))asSalefromdbo.ICSa...
代码写法
select v1.FCustID as CustID, t2.Name, Sum(Round(..... * (IsNull(....)) as Sale
from dbo.ICSale v1
Inner Join dbo.ICSaleEntry v2 On v1.FInterID = v2.FInterID
Left Join t_Organization t2 On v1.FCustID=t2.FItemID
Left Join t_SubMessage T17 On t2.F_109=T17.FInterID
Where
我该怎么写代码才能显示 Sale里面大于五十万的数,小于一百万的数
group by v1.FCustID, t2.FName,t17.FName,t2.F_109 展开
select v1.FCustID as CustID, t2.Name, Sum(Round(..... * (IsNull(....)) as Sale
from dbo.ICSale v1
Inner Join dbo.ICSaleEntry v2 On v1.FInterID = v2.FInterID
Left Join t_Organization t2 On v1.FCustID=t2.FItemID
Left Join t_SubMessage T17 On t2.F_109=T17.FInterID
Where
我该怎么写代码才能显示 Sale里面大于五十万的数,小于一百万的数
group by v1.FCustID, t2.FName,t17.FName,t2.F_109 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询