I have the two following tables. In ONE query, how can I total the column TOTAL_TIME for only those VEHICLE_IDs that have a FEATURE_ID of 2 found in TABLE 2?
Thus in my case the result of the query should be 2:30 as it would add 2:00 and 0:30 because those vehicles have a FEATURE_ID of 2.
TABLE 1
VEHICLE_ID | TOTAL_TIME
—————-+—————–
22 | 2:00
25 | 2:30
22 | 1:25
28 | 0:30
……..
TABLE 2
VEHICLE_ID | FEATURE_ID
—————-+—————–
22 | 2
22 | 3
23 | 1
23 | 3
25 | 1
28 | 2
……..
Could try something like: