sql 多条件查询
select SUM(OrderNum) as OrderNum,Sum(ItemNoNum),electroorderno from (select distinct OrderNum,ItemNoNum,ItemNo,ElectroOrderNo from FA_WMSDB.ServicePos.dbo.SnService where customer_id='00001') t group by ElectroOrderNo,OrderNum
select distinct OrderNum,ItemNoNum,ItemNo,ElectroOrderNo from FA_WMSDB.ServicePos.dbo.SnService where customer_id='00001'
select distinct OrderNum,ItemNoNum,ItemNo,ElectroOrderNo from FA_WMSDB.ServicePos.dbo.SnService where customer_id='00002'
select sum(distinct OrderNum) as OrderNum, sum(ItemNoNum), electroorderno from (select distinct OrderNum , ItemNoNum , ItemNo , ElectroOrderNo from FA_WMSDB.ServicePos.dbo.SnService where customer_id = '00001') t group by ElectroOrderNo, OrderNum
[解决办法]
不同客户的字段意义不同,除非你在客户表增加分类字段,然后分类处理,否则没有办法