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 2000 Forums
 Transact-SQL (2000)
 delete duplicate record

Author  Topic 

imughal
Posting Yak Master

192 Posts

Posted - 2005-01-30 : 23:17:14
i have customer table with following fields

id (identity)
name varchar
custcode varchar

in my table more records has same custcode now i want to keep only one record and delete any further record of same custcode.

how i do that.

thanks

derrickleggett
Pointy Haired Yak DBA

4184 Posts

Posted - 2005-01-30 : 23:39:02
Use NOT EXISTS, NOT IN (not preferrable), or a LEFT OUTER JOIN. This is a pretty simple one, so you should be able to figure out.


MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.
Go to Top of Page
   

- Advertisement -