We have a table with multiple columns and NO column ID. I am trying to delete duplicated rows when ALL columns are matched together. I found CTE to be helpful in this and managed to use it in our Azure SQL Server, but I am now getting the error on the same tables we have in our Synapse Pool:
The query processor could not produce a query plan because the target DML table is not hash partitioned.
I am using this structure of code to delete duplicated rows:
WITH CTE AS(
SELECT [col1], [col2], [col3], [col4], [col5], [col6], [col7],
RN = ROW_NUMBER()OVER(PARTITION BY [col1], [col2], [col3], [col4], [col5], [col6], [col7] ORDER BY col1)
FROM dbo.Table1
)
DELETE FROM CTE WHERE RN > 1