JOIN t b /*CTE*/ON b.ParentDept = a.FullDept /*CTE父项等于原表子项*/ ) SELECT*FROM t ORDERBY FullDept; /* FullDept Dept ParentDept Supervisor lvl -------------------- -------------------- -------------------- -------------------- ----------- S 0 0 CiCi 2 S-FS FS S Jerry 1 S-FS-AP AP S-FS Colin 0