关于两张表查询分组的问题
商品销售明细表a和销售付款明细表b目前的语句是Selectpluname,Sum(sstotal),jzdateFromaWhere(saleno,orgcode)in(...
商品销售明细表a和销售付款明细表b
目前的语句是
Select pluname,Sum(sstotal),jzdate From a Where (saleno,orgcode) in (select saleno,orgcode from b where zfcode in ('7001','64'))
And pluid In (Select pluid From tskuplu k,tcatcategory c Where k.clsid=c.clsid And clscode Like '%82%') And trantype='1' and jzdate between '2018-01-02'and'2018-01-03'
Group By pluname,jzdate ORDER BY jzdate DESC
这个语句是根据b表的支付方式来查询a表的每个商品品类当天的销售总额,我想实现b表支付方式在查询结果中显示,需要怎么改?求指导、 展开
目前的语句是
Select pluname,Sum(sstotal),jzdate From a Where (saleno,orgcode) in (select saleno,orgcode from b where zfcode in ('7001','64'))
And pluid In (Select pluid From tskuplu k,tcatcategory c Where k.clsid=c.clsid And clscode Like '%82%') And trantype='1' and jzdate between '2018-01-02'and'2018-01-03'
Group By pluname,jzdate ORDER BY jzdate DESC
这个语句是根据b表的支付方式来查询a表的每个商品品类当天的销售总额,我想实现b表支付方式在查询结果中显示,需要怎么改?求指导、 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询