如下格式:     Col
    aaaa
    bbbb
    cccc
    ....
转换后
    col
  aaaa,bbbb,cccc,....

解决方案 »

  1.   

    sys_connect_by_path函数,自己查下
      

  2.   

    FYI:http://topic.csdn.net/u/20070829/17/cf34b6c9-6a5d-45f9-9fd4-0c9d72aee97d.html
      

  3.   

    select aaaa,bbbb,cccc,....from
    (select pk,aaaa from table_name) ta,
    (select pk,bbbb from table_name) tb,
    (select pk,cccc from table_name) tc,
    .....
    where table_name.pk=ta.pk(+)
    and table_name.pk=tb.pk(+)
    table_name.pk=tc.pk(+)
    ..........
      

  4.   

    with a as (select 'aaaa' co from dual
               union
               select 'bbbb' co from dual
               union
               select 'cccc' co from dual
              )        
    select substr(max(sys_connect_by_path(co,'->')),3) rm 
    from (select a.*,rownum rn from a)
    start with rn=1
    connect by rn-1=prior rn
      

  5.   

    sys_connect_by_path,oracle9以上版本可以用
      

  6.   

    大家可以取我的博客取看看啊
    我上面寫的是一種方法,還有一種寫函數的方法,在我的博客里面有介紹
    http://jack198409.itpub.net/
      

  7.   

    Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=1880950有详细例子