Oracle hierarchical query on non-hierarchical data

后端 未结 3 1160
无人及你
无人及你 2021-02-07 13:00

I hava data in an Oracle table that is organized as a graph that can contain cycles (see example).

     CREATE TABLE T (parent INTEGER, child INTEGER)
                   


        
3条回答
  •  星月不相逢
    2021-02-07 13:09

    I have not worked with this myself, but what about a CONNECT BY with the NOCYCLE option? That should stop travering the tree when it sees a loop. Oracle 11i definitely has that, I think it came in somewhere in the Oracle 10g period.

提交回复
热议问题