Posted by David Portas on 10/01/14 11:28
What is the key of this table? Please post proper DDL so that we don't
have to guess. I'm going to assume that the combination of all three
columns is unique, in which case try this:
DELETE FROM tbl
WHERE EXISTS
(SELECT *
FROM tbl AS T
WHERE T.table_name_start = tbl.table_name_end
AND T.table_name_end = tbl.table_name_start
AND T.column_name = T.column_name)
AND table_name_start > table_name_end ;
--
David Portas
SQL Server MVP
--
[Back to original message]
|