I have two tables as shown below
ob_period
person_id ob_start_date
1 2007/02/11
2 2008/05/13
3 2008/07/29
4 2006/03/21
visit
person_id visit_date
1 2003/06/21
2 2005/02/23
3 2006/04/19
5 2004/06/11
I would like to update the "ob_start_date" of "ob_period" table with "visit_date" of visit_table
I was trying something like below for update but it can't work as I am not sure how to update with a dynamic value from another table
update ob_period a
set a.ob_start_date = b.visit_date
where a.person_id = b.person_id
I expect my output to be like as shown below
output
person_id visit_date
1 2003/06/21
2 2005/02/23
3 2006/04/19
4 2006/03/21
Can you help me with this please?