I have a situation in which I have two tables (examples below):
As you can see, I do not have a Move Out Date. How could I create a view (SQL Server) that gives a range. For example, I will eventually need to use this view to see where each person lived when they made a purchase, but I am trying to work around the database design that would, ideally, have a MoveOutDate.
My desired results would be as follows:
From what I have read, I suspect I will have to use a CROSS APPLY here, but I have no idea how those work. I tried to do a join off of a subquery of the table, but situations where there are more than two addresses create a many to many relationship.