J
JMSatMetro
I have a query on 2 tables where
Table 1 (tblTAZ-SKIMS) = ALL start and ending nodes (arcs) with their travel
times (3 fields)
Table 2 (tblFacilities) = ending nodes of specific places of interest (1
field)
My query (thus far) is able to pull all the arcs for just my places of
interest using an outer join. The SQL is:
SELECT [tblTAZ-SKIMS].StartTAZ, [tblTAZ-SKIMS].EndTAZ,
[tblTAZ-SKIMS].TravelTime
FROM [tblTAZ-SKIMS] INNER JOIN tblFacilities ON [tblTAZ-SKIMS].EndTAZ =
tblFacilities.TAZ
However, (and the crux of my question) I would like to now only display, for
each StartTAZ, the EndTAZ with the minimum TravelTime, rather than all of the
travel times for each combination. To visualize this in output terms, my
original query output looks like this (with only 3 places of interest):
StartTAZ EndTAZ TravelTime
1 1 .23
1 3 5.8
1 7 10.2
2 1 2.6
2 3 5.9
2 7 13.2
3 1 6.2
3 3 .32
3 7 8.9
.... ... ...
And I want the output to look something like this:
StartTAZ EndTAZ TravelTime
1 1 .23
2 1 2.6
3 3 .32
....
Can I implement this in the SAME query, without having to write a second
stage query?
Table 1 (tblTAZ-SKIMS) = ALL start and ending nodes (arcs) with their travel
times (3 fields)
Table 2 (tblFacilities) = ending nodes of specific places of interest (1
field)
My query (thus far) is able to pull all the arcs for just my places of
interest using an outer join. The SQL is:
SELECT [tblTAZ-SKIMS].StartTAZ, [tblTAZ-SKIMS].EndTAZ,
[tblTAZ-SKIMS].TravelTime
FROM [tblTAZ-SKIMS] INNER JOIN tblFacilities ON [tblTAZ-SKIMS].EndTAZ =
tblFacilities.TAZ
However, (and the crux of my question) I would like to now only display, for
each StartTAZ, the EndTAZ with the minimum TravelTime, rather than all of the
travel times for each combination. To visualize this in output terms, my
original query output looks like this (with only 3 places of interest):
StartTAZ EndTAZ TravelTime
1 1 .23
1 3 5.8
1 7 10.2
2 1 2.6
2 3 5.9
2 7 13.2
3 1 6.2
3 3 .32
3 7 8.9
.... ... ...
And I want the output to look something like this:
StartTAZ EndTAZ TravelTime
1 1 .23
2 1 2.6
3 3 .32
....
Can I implement this in the SAME query, without having to write a second
stage query?