the oracle Start with ... connect by prior Usage (tree query)

The project will often encounter tree data query, there are many ways in which there is a relatively simple form to query, but of course this is the oracle provided a method of their own, such as:

select t.*,rowid
  from app_knowledge_base t
 start with t.id in (100)
connect by prior t.id = parent_title_id
order by t.id,t.show_num

1, CONNECT BY PRIOR is used in structured query;

2, the role START WITH ... CONNECT BY PRIOR ... is, simply put, is a tree structure stored in a table.

 

Reference: https://blog.csdn.net/qq_39986274/article/details/81033704

Published 118 original articles · won praise 59 · views 490 000 +

Guess you like

Origin blog.csdn.net/u012255097/article/details/104470411