I have two tables 1.Table_A 2.Table_B I would like to update table_A particular column using table_B new values for that column, it might happen that number of rows from Table_A doesn't match Table_B. I know how to write query for updating Table_A using SQL but not sure how do I do it in pandas, I need an equivalent of update query in pandas
Update Query :
update table_A
set dt_of_join = sq.dt_of_join
from (select id_emp, max(joining) as dt_of_join
from table_B
group by id_emp ) as sq
where table_A.id_emp = sq.id_emp
I need equivalent of above query in Pandas Dataframe, any help really appreciated.
Example :
Table_A
id_emp | dt_of_join
2 | 30-03-2018
4 | 03-04-2018
5 | 04-05-2018
7 | 10-06-2018
12 | 20-07-2018
10 | 09-08-2018
19 | 25-12-2018
Table B is the subquery that is inside the above query
Table_B
id_emp | dt_of_join
4 | 01-01-2019
12 | 03-02-2019
10 | 09-05-2019
5 | 21-06-2019
After update query is successful the table_A should look like this
Table_A
id_emp | dt_of_join
2 | 30-03-2018
4 | 01-01-2019
5 | 21-06-2019
7 | 10-06-2018
12 | 03-02-2019
10 | 09-05-2019
19 | 25-12-2018