mysql递归查询树形的叶子时间:2022-09-19 10:16:47SELECT t.name, t.unit_id, t.parent_id FROM `scpi_unit_struct` t WHERE NOT EXISTS( select * from `scpi_unit_struct` t1,`scpi_unit_struct` t2 where t1.unit_id=t2.parent_id AND t.unit_id=t1.unit_id )