Guest User

Untitled

a guest
Oct 17th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. WHILE EXISTS (SELECT COUNT(*) FROM Employee GROUP BY EmpID, EmpSSN HAVING COUNT(*) > 1)
  2. BEGIN
  3. DELETE FROM Employee WHERE EmployeeID IN
  4. (
  5. SELECT MIN(EmployeeID) as [DeleteID]
  6. FROM Employee
  7. GROUP BY EmpID, EmpSSN
  8. HAVING COUNT(*) > 1
  9. )
  10. END
Add Comment
Please, Sign In to add comment