SQL Server 中的分层与递归查询
Jasmin Ludolf
Content Developer

部件的不同层级:

用于创建层级的元素:
PartID 和 SubPartID用于描述特性的元素:
Component:EngineTitle:V6BiTurboVendor:BMWProductKey:EV3891ASFCost:3000Quantity:1
+-----------------+---------------------------+
| Component | Level |
|-----------------|---------------------------|
| SUV | 1 |
|-----------------|---------------------------|
| Body | 2 |
|-----------------|---------------------------|
| Hood | 3 |
+-----------------+---------------------------+
+-----------------+---------------------------+
| Component | Quantity |
|-----------------|---------------------------|
| SUV | 1 |
|-----------------|---------------------------|
| Body | 1 |
|-----------------|---------------------------|
| Wheels | 4 |
+-----------------+---------------------------+
SQL Server 中的分层与递归查询