在 MS SQL Server 上,我想在一次选择中加入一些表。
表:
追踪:
Segment_ID | Track_INFO
Segment_ID:
Segment_ID | Road_ID
路:
Road_ID | Road_INFO
所以我想从 Track and Road 表中选择信息。我知道如何加入两个表:
SELECT
Segment_ID = T1.Segment_ID,
Track = T1.Track,
--Road_ID = Segment_ID.Road_ID
FROM dbo.Track T1,dbo.Road T2
LEFT JOIN Segment_ID Segment_ID ON Segment_ID.Segment_ID = T1.Segment_ID
--LEFT JOIN Road Road_ID ON Road.Road_ID = Segment_ID.Road_ID
但是在我的情况下如何加入?