Deleting Duplicate Rows in a SQL Server Table Using a CTE

SQL Server logo

Finding duplicate rows in a table is quite simple. Deleting only the duplicates – as opposed to deleting all rows that have duplicates – is a bit more complicated. I have a table variable called “@Readings” with the following schema: First, I load the table with data from another database on a linked server called … Read more