title: SQL Insert Into with Inner Join
body: <p>I want to make my insert query which has an inner join to the Users table.</p>
  
  <p>The example of the tables is like this:</p>
  
  <p>Users:</p>
  
  <pre><code>id | fullName | preferredName | email              | mobile   | password
  1  | Pan Lim  |  Lim          | limpan45@gmail.com | 64557812 | passone
  2  | Gong My  |  Gong         | gong45@gmail.com   | 61345671 | passtwo
  </code></pre>
  
  <p>Orders:</p>
  
  <pre><code>id | userid(Foreign key of "id" from Users | timestamp
  1  |               1                       | 2016-06-10 11:45:31
  </code></pre>
  
  <p>I'm trying to insert into Orders relating to only knowing the userid from the Users table. It show like this: </p>
  
  <p>Orders:</p>
  
  <pre><code>id | userid(Foreign key of "id" from Users | timestamp
  1  |               1                       | 2016-06-10 11:45:31
  2  |               2                       | 2016-08-14 12:45:31
  </code></pre>
  
  <p>But when I test on my SQL query, it has error on this query.</p>
  
  <pre><code>INSERT INTO Orders (id, userid, timestamp) 
  SELECT Orders.id, Orders.userid, Orders.timestamp FROM Users INNER JOIN Orders ON  Orders.id = Users.id
  </code></pre>