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.
| Author |
Topic |
|
subhaoviya
Posting Yak Master
135 Posts |
Posted - 2009-06-01 : 08:46:35
|
| i have table with id,empnam,age i want to delete the duplicate records base id.how to do it? |
|
|
senthil_nagore
Master Smack Fu Yak Hacker
1007 Posts |
Posted - 2009-06-01 : 08:50:42
|
| Mr Anand or Miss Subha,Weather the id column id Primary key?Senthil.C------------------------------------------------------[Microsoft][ODBC SQL Server Driver]Operation canceled |
 |
|
|
LoztInSpace
Aged Yak Warrior
940 Posts |
|
|
senthil_nagore
Master Smack Fu Yak Hacker
1007 Posts |
Posted - 2009-06-01 : 09:18:09
|
| delete from mytable where id not in(select max(id) as id from mytable m group by name,num )Senthil.C------------------------------------------------------[Microsoft][ODBC SQL Server Driver]Operation canceled |
 |
|
|
subhaoviya
Posting Yak Master
135 Posts |
Posted - 2009-06-02 : 03:41:13
|
quote: Originally posted by senthil_nagore delete from mytable where id not in(select max(id) as id from mytable m group by name,num )Senthil.C------------------------------------------------------[Microsoft][ODBC SQL Server Driver]Operation canceled
thanks senthil its working fine |
 |
|
|
|
|
|