需求:需要将列转行之后的工序按照待执行工序号排序,如果一样按工序号排

解决方法如下:

select part_no, max(ywggx) ywggx
		from(select   mt.part_no ,
         wm_concat(mrl.procedure_name) over(partition by mt.part_no order by to_number(mrl.fserial),to_number(mrl.procedure_no))  ywggx
         from manu_taskinfo mt 
    left join manu_routecard mr on mt.task_id = mr.task_id
    left join manu_routecardlist mrl on mrl.routecard_id = mr.routecard_id
    where   mrl.state= '3'  or mrl.state = '4'

  

posted on 2017-11-23 17:28  喃博思睿  阅读(3403)  评论(0编辑  收藏  举报