Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Duplicates are known and now to delete them
Message
From
24/04/2012 18:01:00
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2008
Application:
Web
Miscellaneous
Thread ID:
01542530
Message ID:
01542539
Views:
39
>
>;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
Previous
Reply
Map
View

Click here to load this message in the networking platform