select top(10) FModelCode,FProductTypeName,FBrandName,FOrganizationName,KOrganizationID,count(0) FALLCount, sum(case when FStatus >1 then 1 else 0 end) SaleCount, sum(case when FStatus >0 then 1 else 0 end) SendCount from VProduct group by FModelCode,FProductTypeName,FBrandName,FOrganizationName,KOrganizationID order BY SaleCount DESC
sum(如果符合条件1否则0) 这样就可以按照条件统计个数了