I have one table of "Applicants" that spans two years.
Of last years "Applicants" about 50% were hired and have and employee ID ("EMPID" is not a key).
This year's Applicants are in the same table. I can tell which year is which by the 9 digit "keyApplicantID" (PK); this year's start with 2008xxxxx.
I need to update this year's applicants EMPID if we hired them last year so they will have the same EMPID this year that they did last year. keyApplicantID will be different and unique for every record. I can match last years record to this years on the SSN field (Social Security Number).
Is this close?
UPDATE Applicants AS a
SET EMPID =
FROM Applicants AS b
WHERE EMPID IS NOT NULL
AND keyApplicantID < 200800000
Where keyApplicantID > 200800000
AND a.SSN = b.SSN