SQL Fiddle: http://sqlfiddle.com/#!2/b46ea/2
Current SQL:
SELECT `vehicle_journey`.*,
ADDTIME(departure, SEC_TO_TIME((1))) AS stopDepartureTime
FROM `vehicle_journey`
INNER JOIN `vehicle_journey_days`
ON `vehicle_journey_days`.`journey_reference` = `vehicle_journey`.`reference`
INNER JOIN `journey_pattern`
ON `journey_pattern`.`reference` = `vehicle_journey`.`journey_pattern_reference`
INNER JOIN `journey_pattern_timing_link`
ON `journey_pattern_timing_link`.`section` = `journey_pattern`.`journey_pattern_section`
WHERE `journey_pattern_timing_link`.`stop` = '1900HA030193'
AND `vehicle_journey_days`.`day` = 'MondayToFriday'
The ultimate goal of this SQL statement is to get the bus arrival time based on its departuretime in vehicle_journeyand run_timeout journey_pattern_timing_link.
The reason this is difficult and why I ask for help is due to the nature of the table journey_pattern_timing_link. The table is configured to provide the time in seconds that it takes to move from one stop to the next (this is the time relative to the time of each departure).
select, . ADDTIME - , . "1" , . , , SEC_TO_TIME, .
, ? , journey_pattern_timing_link. , run_time journey_pattern_timing_link, LESS , where journey_pattern_timing_link. section .
, , , . SQL Fiddle .