0
我有自我加入表。這張桌子被用來加入4層,即:在自我加入表中獲取父母親
Region -> Country -> County -> Town
我該如何獲得城市之父。要做到這一點高達兩個級別這是查詢
SELECT t.ShortName AS Town,
(SELECT c.ShortName FROM Locations c
WHERE c.LocationId = t.ParentId) AS County
FROM Locations t
WHERE t.LocationId = 100
現在想獲得國家是縣的父母。