Dups: Returning Survivor Record and single records
Posted on 2014-03-09
I have two tables Employees and Dups. The Dups table holds employee ids, what id they are a dup of, and which record is the survivor. I want to join with the employees table, pull out the survivor record and the other employees that are singles.
Emplid Curr_Emplid Correct_Emplid Survivor
1234 1234 5678 N
5678 5678 5678 Y
1122 1122 5678 N
So basically, employees 1234,5678, and 1122 are all the same person but the emplid with all the correct data is 5678. Employees 1111 and 6765 do not have dups so their records are correct.
I want to query Employee and have it only return