title: SQL error using INNER JOIN function to insert values
body: <p>I'm having a problem with my simple SQL code as I'm just a beginner.
  I'm trying to retrieve the average value of outbound-cost-pal for different countries and write this in every corresponding line of Warehouse.</p>
  
  <p>My code is the following:</p>
  
  <pre><code>INSERT INTO Warehouse (`inbound-cost-pal`)
  SELECT cost.`average`
  FROM Warehouse AS wh
  INNER JOIN (
      SELECT  
      AVG     (`warehouse-cost-table`.`outbound-cost-pal`) AS `average`
      FROM    `warehouse-cost-table` 
              )cost
  ON wh.`location-tariff-code` = LEFT(cost.`country`,2)
  ;
  </code></pre>
  
  <p>I'm receiving the error message 'Unknown column 'cost.country' in 'on clause''.</p>