title: Insert into table select from table a and table b where
body: <p>I want to insert data into a table by joining two tables with a where condition that each id matches.</p>
  
  <pre><code>INSERT INTO SALES(T_ID, SF)
  SELECT B.T_ID, B.SF
  FROM HIS B, SALES C
  WHERE C.REP_ID=B.REP_ID;
  </code></pre>
  
  <p>I am getting an error that I cannot insert NULL into ("c.REP_ID")</p>
  
  <p>I am not trying to insert anything into c.rep_id. I want to insert values into t_id, sf from HIS table where the rep_id on his table = rep id on sales table.</p>