用一张表存一张树结构
表结构
支 叶
mastertype subtype
0 01
0 02
0 03
01 0101
01 0102
01 0103
02 0201
02 0202
02 0203
用ORACLE直接查询
select level||'层' as 层,lpad('',level*5)||subtype,mastertype,subtype
from LQSHDGSLBRELATION start with mastertype='01'
CONNECT BY PRIOR mastertype = subtype
能查到结构