What you want to see on DotNetFunda.com ?
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 8196 |  Welcome, Guest!   Register  Login
 Home > Code Snippets > SQL Server > TO Eliminate Duplicate Data From Duplicate Table???????? ...
Sabarimahesh

TO Eliminate Duplicate Data From Duplicate Table????????

 Code Snippet posted by: Sabarimahesh | Posted on: 5/8/2012 | Category: SQL Server Codes | Views: 506 | Status: [Member] | Points: 40 | Alert Moderator   


To Find
WITH Temporary_table (Empid,Sub_id, Count_Duplicate)
AS
(
SELECT Empid,Sub_id,ROW_NUMBER() OVER(PARTITION BY Empid,Sub_id ORDER BY Empid) AS Count_Duplicate FROM Emp_table
)

To Eliminate
DELETE FROM Temporary_table WHERE Count_Duplicate > 1

Life is a Race
Thanks & Regards
By
Sabari Mahesh P M
Found interesting? Add this to:


>> Write Response - Respond to this post and get points

More codes snippets

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/26/2013 5:00:35 AM