title: Using Select & Insert in the same query
body: <p>I have three tables and I'm trying to do a SELECT from one and INSERT to the other with using ON on the three columns with the same values.</p>
  
  <p>Here's what I trying...</p>
  
  <pre><code>INSERT INTO
  CustomerDetails_TEST
  (Region_ID)
  
  SELECT
  RegionStatesUS.Region_ID
  
  LEFT JOIN Customers ON Customers.Customer_ID = CustomerDetails_TEST.Customer_ID
  LEFT JOIN RegionStatesUS ON RegionStatesUS.RegionState = Customers.BillingStateOrProv
  
  FROM Customers
  WHERE Customers.Customer_ID = CustomerDetails_TEST.Customer_ID
  </code></pre>
  
  <p>The tables are...</p>
  
  <pre><code>CustomerDetails_TEST
  RegionStatesUS
  Customers
  </code></pre>
  
  <p>And I'm trying to <code>INSERT</code> the value from <code>RegionStatesUS.Region_ID</code> using the <code>Customer_ID</code> <code>INTO</code> <code>CustomerDetails_TEST</code>.<code>Region_ID</code></p>
  
  <p>What am I missing here?</p>