I have an SQL Server 2012 table with ID, First Name and Last name. The ID is unique per person but due to an error in the historical feed,
ID, First Name
Last name
ID
SELECT * FROM myTable WHERE ID IN ( SELECT ID FROM myTable GROUP BY ID HAVING MAX(LastName) <> MIN(LastName) OR MAX(FirstName) <> MIN(FirstName) ) ORDER BY ID, LASTNAME
SELECT ID FROM <<Table>> GROUP BY ID HAVING COUNT(*) > 1;