'Merging two tables - one ID can have multiple address

I have to write a stored procedure that merges two tables. The one is a staging table, and the other our main table. The problem is one user can have more than one address. There is a column for when the address was registered. I just want the latest address. How can I do this in a merge? If not in a merge then what other options do I have?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source