would help to see some example data and the result required from that data.
suggest this might work, but no guarantees, it is extremely inefficient and will need updating every time you have a new operator
Code:
select date, operator1_hrs*operator1.cost, operator2_hrs*operator2.cost
from forecast, operator as operator1, operator as operator2
where operator1.ID=1 and operator2.ID=2
At the moment, looks like your second table is not constructed correctly - I would expect to see
ID
Date
operatorID
operatorHours
and your query would be
Code:
select date, operatorID, operatorHours*operator.cost
from forecast INNER JOIN operator ON operator.ID=forecast.operatorID
you can turn this into a crosstab if you want to see operators side by side