select id,name,substr(max(sys_connect_by_path(tool,'/')),2) from 
(select a.id,a.name,b.id bid,b.tool ,row_number() over(partition by a.id order by b.tool) t from a,b where a.id=b.id(+) group by a.id,a.name,b.id,b.tool)
connect by prior t=t-1 start with t=1 group by id,name;
时间太急,有事要出去,没测试,应该没有太大问题,你测试一下,回来再说

解决方案 »

  1.   

    一定要用prior?
    我按照这个运行
    也许是库的数据量太大了
    运行不出来中间这部分
    (select a.id,a.name,b.id bid,b.tool ,row_number() over(partition by a.id order by b.tool) t from a,b where a.id=b.id(+) group by a.id,a.name,b.id,b.tool)
    可以运行出来但是一起,运行了2个小时了,还没出用toad运行的
      

  2.   

    是不是
    connect by prior t=t-1 start with t=1 group by id,name;
    有问题呢?
    感觉有点像
    谢谢Visual_Studio_Net(打鼠英雄) 啊
      

  3.   

    刚刚学习了一下
    看来要把数结构给构建好就可以 connect by
    因为是在家,没库
    等去单位在试试