一個簡單的數據結構,如這樣:CTE重複引用
ID parentID Name (Table: VehicleType)
1 Vehicle
2 1 Small
3 2 Car
4 2 Motorcycle
5 1 Medium
6 5 Pickup
ID ItemType Name (Table: Vehicle)
1 3 Golf
2 4 125
是不是可以使用CTE以結果爲:
VehicleType Name
Vehicle Golf
Small Golf
Car Golf
Vehicle 125
Small 125
Motorcycle 125
我想創建爲每發現車輛類型寄存器,嘗試一切都沒有成功。
表'VehicleType'看似尋常給我。它給了什麼信息? –