How can I delete duplicate rows where no unique row id exists?
unique row id
My table is
col1 col2 col3 col4 col5 col6 col7 john 1
-- this query will keep only one instance of a duplicate record. ;WITH cte AS (SELECT ROW_NUMBER() OVER (PARTITION BY col1, col2, col3-- based on what? --can be multiple columns ORDER BY ( SELECT 0)) RN FROM Mytable) delete FROM cte WHERE RN > 1