http://expert.csdn.net/Expert/topic/1551/1551178.xml?temp=.1207849

解决方案 »

  1.   

    看了一下上面连接的讨论
    通过存储过程建立树结构查询的游标可以对每个节点进行判断
    类似语句
    select * from mytable a
    where ....
    connect by prior a.c=a.f
    start with a.f='aaa'
    那样会有很多没有父的子纪录。因为子节点可能满足限制条件也可能不满足。
    我需要的是父节点不满足条件的子节点也不分解出来
    如:
    select * from mytable a
    connect by prior a.c=a.f and (...)
    start with a.f='aaa'顺便说一下通过存储过程我已经实现了,就是效率不高。难点是判断条件在外表