Connect by prior start with is often used when a table has a recursive relationship. For example, we often store a complex directory tree in a table. You can also store some departments in a table, and these departments are affiliated with each other. In this case, you will use connect by prior start. The typical method is: www.2cto.com select * from table connect by prior cur_id = parent_id start with cur_id = ??? For example: a b1 02 13 14 25 3 if you want to search for all the data in a = 2 and below, then: select * from table connect by prior a = B start with a = 2a b2 14 2 these are just the basics. In fact, as long as you flexibly construct query statements. Unexpected results can be obtained. For example, every path in the tree is generated. However, the tree composed of these records must be normal. If there is a parent-child relationship, a loop error occurs! Select * from tb_cus_area_cde -- Obtain the parent select * from tb_cus_area_cde a connect by prior. c_snr_area =. c_area_cde start with. c_area_cde = '000000' -- the parent selects the sub-select * from tb_cus_area_cde a connect by prior. c_area_cde =. c_snr_area start with. c_snr_area is null Note: when using this function, the statement parameter must use ResultSet. TYPE_SCROLL_INSENSITIVE instead of ResultSet. TYPE_SCROLL_SENSITIVE: 1. TYPE_FORWORD_ONLY, which can be rolled forward only; 2.TY PE_SCROLL_INSENSITIVE, two-way scrolling, but not timely updating, is that if the data in the database has been modified, it is not reflected in the ResultSet. 3. TYPE_SCROLL_SENSITIVE, two-way scrolling, and timely tracking of database updates, in order to change the data in the ResultSet.