select to4.ProportionOfRoute, to4.RouteID
from tbl_operatorrouterelation to4
where to4.operatorID = (
select to2.operatorid
from tbl_operatordesc to2
where to2.Name = "OK Travel"
)
select tr.Frequency, tr.routeID
from tbl_route tr
where tr.routeID IN (
select to3.RouteID
from tbl_operatorrouterelation to3
where to3.operatorID = (
select to2.operatorid
from tbl_operatordesc to2
where to2.Name = "OK Travel"
)
)
So the first one selects values from a table with multiple unique RouteID's. The second one selects values from another table with those same RouteID's.
I need to multiple the ProportionOfRoute's with the corresponding Frequency values together so this all has to be in one query.
Thanks! I've been working on this for 2 days now