What is the easiest way to delete records with a duplicate name in a table? The answers that I came across are very confusing.
Removing duplicate records from a table
I understood! Simple and it worked great.
delete t1 from tTable t1, tTable t2 where t1.locationName = t2.locationName and t1.id > t2.id
http://www.cryer.co.uk/brian/sql/sql_delete_duplicates.htm
SQL Server 2005:
with FirstKey AS ( SELECT MIN(ID), Name, COUNT(*) AS Cnt FROM YourTable GROUP BY Name HAVING COUNT(*) > 1 ) DELETE YourTable FROM YourTable YT JOIN FirstKey FK ON FK.Name = YT.Name AND FK.ID != YT.ID
Source: https://habr.com/ru/post/1707970/More articles:How to programmatically disable the Windows XP Print Spooler service in C # - c #Transferring data between flex components - flexList of all files that were not edited during the year in CVS - version-controlhow you execute a function in a list of objects using LINQ - foreachThe request for svn revision suddenly seems slow (so how can svn 1.5 be?) - svnpython: can i extend the upper bound of the range () method? - pythoniPhone: What is a springboard? Do I need to take care? - iphonePygame cannot find include file "sdl.h" - pythonhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1707974/windows-command-line-tool-analagous-to-unx-tail-command&usg=ALkJrhjgMt1DgWCqlqcbe30nP766ywMb0QSyntax highlighting for several languages ββin one file: StatWeave / SAS / LaTeX - editorAll Articles