I was trying to update table columns from another table.

![Person Table](https://i.stack.imgur.com/TPBfo.jpg)

In `person` table, there can be multiple contact persons with same `inst_id`.

I have a `firm` table, which will have latest 2 contact details from `person` table.

I am expecting the `firm` tables as below:

![Firm Table](https://i.stack.imgur.com/p7OpQ.jpg)

If there is only one contact person, update `person1` and `email1`. If there are 2, update both. If there is 3, discard the 3rd one.

Can someone help me on this?