記錄一發wm_concat()函數排序的問題


需求:需要將列轉行之后的工序按照待執行工序號排序,如果一樣按工序號排

解決方法如下:

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'

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM