日期:2014-05-16 浏览次数:20464 次
select sp.orderno,sp.deptno,sp.zb_ordertime, sp.consumer,sp.computertypeno,sp.servicetype, sp.computerid,sp.product_code,sp.system, op.orderprogress,sa.updatetime,sa.actionno,sa.missreason, r.reason from servicerepair sp,serviceaction sa,orderprogress op,reason r where sp.orderno = sa.orderno and sp.orderprogressno = op.orderprogressno and sp.orderprogressno in (-1,0,1,2,3,4) and sa.missreason = r.reasonno and sp.deptno = 'GZ' and (sa.orderno,sa.actionno) in ( select s.orderno,max(s.actionno) from (select sp.orderno,sa.actionno from servicerepair sp,serviceaction sa where sp.orderno = sa.orderno and sp.orderprogressno in (-1,0,1,2,3,4) and sp.deptno = 'GZ') s group by s.orderno );