You are here: Re: delete of mirrored rows « MsSQL Server « IT news, forums, messages
Re: delete of mirrored rows

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
--

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация