insert into database1.table select * from database2.table where id not in(select id from database1.table);