1

I know is possible to insert rows (not by every single values) with this definition:

insert into table1 select * from table2

But what if I need to transfer rows from one database_1 table to another database_2 table? (considering that the number of columns will always match)

I would like something like this:

c_database_2.execute('''SELECT * FROM table 
                        WHERE date = ? 
                        AND timestamp = ?''', (a, b) 
row = c_new.fetchone() 

c_database_1.execute("INSERT INTO table SELECT * FROM ?", (row)) 
1
  • Sorry, I didn't notice they were from separate dbs. Commented Nov 1, 2017 at 12:43

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.