Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Delete duplicate data

Author  Topic 

rexyrexin
Starting Member

19 Posts

Posted - 2011-09-21 : 14:11:40
I have a table, EMP.


EMP
-----
Empid EmpName City nuumber
------------------------------------------------
1 rahul noida 321
2 abhi noida 987
3 dippy noida 123
4 tom noida
1 rahul 321


Now I want to delete duplicate rows which have same empid but have less data in their columns than the other one.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-09-21 : 14:14:44
Define "less data".

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

rexyrexin
Starting Member

19 Posts

Posted - 2011-09-21 : 21:00:23
I have two rows having same data i.e. empid. But one row has one column missing . So I want to delete that row only.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-09-21 : 21:07:54
Will it be the same column each time or can it be different columns where the data is blank/null/empty?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

rexyrexin
Starting Member

19 Posts

Posted - 2011-09-22 : 08:04:56
Thanks for replying. I have done using Rank()
Go to Top of Page
   

- Advertisement -