I am new to SQL and using MYSQL Workbench. In this query, I am trying to find duplicate values and then delete the duplicates(anything > 1) But I am getting the error "The target table RowNumCTE of the DELETE is not updatable"
-- Remove duplicates
With RowNumCTE as(
select *,
row_number() over (
partition by ParcelID,
PropertyAddress,
SalePrice,
SaleDate,
LegalReference
order by UniqueID) row_num
from portfolioproject.nashvillehousing)
delete
from RowNumCTE
where row_num > 1;
Your guidance will be highly appreciated.