title: Python MySQLdb select from and insert into another database
body: <p>I have a table looks like this:</p>
  
  <pre><code>part    min    max    unitPrice
  A       1      9      10
  A       10     99     5
  B       1      9      11
  B       10     99     6
  ...
  </code></pre>
  
  <p>I also have a production table that I need to insert the previous data into this production one. 
  When I do the select statement from one table and fetch the record, I have a hard time insert into another table. </p>
  
  <p>Say </p>
  
  <pre><code>cursor_table1.execute('select part, min, max, unitPrice, now() from table1')
  for row in cursor_table1.fetchall():
      part, min, max, unitPrice, now = row
      print part, min, max, unitPrice, now
  </code></pre>
  
  <p>The result turns out to be</p>
  
  <pre><code>'416570S39677N1043', 1L, 24L, 48.5, datetime.datetime(2018, 10, 8, 16, 33, 42)
  </code></pre>
  
  <p>I know Python smartly figured out the type of every column but I actually just want the raw content. So I can do something like this:</p>
  
  <pre><code>cursor_table1.execute('select part, min, max, unitPrice, now() from table1')
  for row in cursor_table1.fetchall():
      cursor_table2.execute('insert into table2 values ' + str(tuple(row)))
  </code></pre>
  
  <p>The question is how can simply do a select statement from one table and add it to another. </p>
  
  <p>Let me know if I did not describe my question in a clear way and I can add extra info if you want. </p>