79378323

Date: 2025-01-22 15:28:01
Score: 2.5
Natty:
Report link

1st find out the duplicate rows by using CTE then use this temporary table as condition in delete clause You can checkout this link for clear understanding: https://youtu.be/b09dWRVk7BY

WITH CTE AS
(SELECT EmployeeName, 
          ROW_NUMBER() OVER(PARTITION BY EmployeeName ORDER BY EmployeeName) AS R
   FROM employee_table
   
delete from employee_table
where EmployeeName IN (
  select EmployeeName from CTE 
  where R>1) 
Reasons:
  • Blacklisted phrase (1): youtu.be
  • Blacklisted phrase (1): this link
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Knowledge Quest