Use SQL to recursively query whether the primary key parent node is named to describe the leaf www.2cto.com node RES_CAT_ID IS_LEAFNODE 1 127f 1 0 Agricultural Science 0 06-12 months-12 03.52.09.074000 PM 3 127f 1 0 plant protection 0 06-12 months-12 03.52.34.545000 Pm 4 * F 1 0 crop Crop 0 06-12 months-12 03.52.50.804000 PM 5 1 1 1 1 Basic Agricultural Discipline 0 06-12 months-12 03.53.24.490000 PM 6 1 1 1 plant protection 0 06-12 months-12 03.53.43.328000 PM 7 2 1 1 Soil Science 0 07-12 months-12 10.34.10.163000 am 8 127f 1 1 animal husbandry 0 07-12 months-12 10.38.43.331000 AM 2. F 1 0 basic agricultural science 0 06-12 months-12 03.52.23.398000 afternoon RES_CAT_PAR_ID first column: RES_CAT_ID second column: RES_CAT_PAR_ID third column: IS_LEAFNODE query data of all leaf nodes of a node select t. res_cat_id, t. res_cat_name, t. res_cat_par_id from irc_res_cat t where t. res_cat_id <> '2' start with t. res_cat_id = '2' connect by prior t. res_cat_id = t. res_cat_par_id and t. is_del = '0' and t. is_leafnode = '1'
Query all the leaf node data in the root directory select t. res_cat_id, t. res_cat_name, t. res_cat_par_id from irc_res_cat t where t. res_cat_par_id = '1 _ F' and t. is_leafnode = '1'