I have a query that spits out the following result set
Basically it is a result set of which state an employee was in on a certain date and what their status was. What I need is a way to get the rows where the employee switched states or changed from Inactive to Active. I have highlighted the rows I need in the picture. I can get the results using complex joins but I wanted to see if this was possible using some partition function.
Any help is greatly appreciated.