查询生产订单中某个(些)工作中心对应的标准文本码

写一段SQL,用来查询系统内实际发生的业务中,某一个或某一些工作中心,对应了哪些工序文本码。话不多说,请看代码。

代码
select    crhd.arbpl, afvc.ktsch, afvc.ltxa1, count(*)
from     afvc    --订单的工序
        inner join 
        afko    --订单表头数据PP订单
        on    afko.aufpl = afvc.aufpl and 
            afko.mandt = afvc.mandt
        left outer join 
        CRHD    --工作中心表头
        on  afvc.mandt = CRHD.mandt    and
            afvc.arbid = crhd.objid
where    afvc.mandt = '600' and 
        crhd.arbpl in ('WK1101', 'WK1102', 'WK1105')
group    by    crhd.arbpl, afvc.ktsch, afvc.ltxa1
order    by    crhd.arbpl, afvc.ktsch, afvc.ltxa1;


版权声明:本文为rarenmen原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。