'How to delete Duplicates from table in mysql

WITH EmployeesCTE AS
(
   SELECT *, ROW_NUMBER() OVER (PARTITION BY ID ORDER BY ID) AS RowNumber
   FROM Employees
)
DELETE FROM EmployeesCTE WHERE RowNumber > 1;

Gives following Error:

Error Code: 1288. The target table EmployeesCTE of the DELETE is not updatable

What will be solution for above query in mysql



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source