有时候在界面常可以看到一种树形结构的案例: 那么在数据库中是怎么设计的呢? 给一个案例: create table Employee ( parent_id int,--这个作为关联本身的父类节点 child_id int, name varchar2(20) ) insert into employee values(1,2,'第2个'); insert into employee values(1,3,'第3个'); insert into employee values(2,4,'第4个'); insert into employee values(2,5,'第5个'); insert into employee values(3,6,'第6个'); insert into employee values(3,7,'第7个'); insert into employee values(4,8,'第8个'); insert into employee values(4,9,'第9个'); insert into employee values(5,10,'第10个'); insert into employee values(5,11,'第11个'); insert into employee values(8,12,'第12个'); insert into