Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Duplicates are known and now to delete them
Message
De
24/04/2012 18:01:00
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2008
Application:
Web
Divers
Thread ID:
01542530
Message ID:
01542539
Vues:
41
>
>;with cte as (select ClientID, row_number() over (partition by ClientName, ClientCity order by AddedDate) as Rn from dbo.Client)
>
>delete from cte where Rn > 1
>
>-------------------
>This is assuming that you want to eliminate duplicates by ClientName and ClientCity. Use the correct field names in the parition by clause.

This works. Thanks

I double checked the number of records and there is in fact 192 less records. I also double checked to make sure there wasn't any more duplicate and they are all gone.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform