ORACLE 单列查询变单行显示

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

    SELECT substr(sys_connect_by_path(dutywork, ';'), 2)  
      FROM (select dutywork,rownum rn  
              from t_test)  
     WHERE connect_by_isleaf = 1  
     START WITH rn = 1  
    CONNECT BY prior rn = rn - 1;  

查询表t_test的一列,查询出的结果,显示为一行,各个行之间以“;”分割