多列合併為一列一欄,再排序

  • 705
  • 0
  • SQL
  • 2014-01-03

摘要:先重排順序,再將多列合併成一欄

select replace(wmsys.wm_concat(TO_CHAR(CATALOG_NAME)),',','-')  from (
 SELECT CATALOG_NAME ,catelog_level FROM yimt004   
      START WITH yimt004_id in('867')
        CONNECT BY prior parents_id=  yimt004_id order by catelog_level asc
        )