I have a table defined as such:
And want the result set below:
How would I code this in t-sql? This is basically a small workflow where the higher rank value is higher up the approval chain. In the result set I just want to see for Bob that his approver Email is that of Susie and so on until the last Employee (Ned) who would not have any ApproverEmail value. There may not only be 4 total records.