How to insert they same field in other database [closed]

余生长醉 提交于 2020-04-18 05:39:51

问题


Lets say i have 2 databases.The column names of the two databases are as follows:

db1: name, age, gender, mother_name, father_name  
db2: name, gender, status, birthdate

As you can see, both db1 and db2 have common fields of 'name' and 'gender'. I want to insert the data from db2 in db1 which have they same fields.


回答1:


if you give us an expected output it could be more precise. But as i understand:

db1 = db1.merge(db2, on=["name","gender"], how="left")


来源:https://stackoverflow.com/questions/59445001/how-to-insert-they-same-field-in-other-database

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!