View Single Post
  #4 (permalink)  
Old February 2nd, 2004, 11:45 AM
planoie's Avatar
planoie planoie is offline
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

By "rowid" ankur was suggesting that you have something in your table that uniquely identifies each row (like an identity column). (Of course, if this were the case, then technically your wouldn't have duplicate rows.)

Is this a process you need to run regularly? Or is this something you are doing just to clean up some data? If this is a regular occurance, you should re-consider your table design. You shouldn't allow the insertion of duplicate data.

In order to only delete one row, you need some means of uniquely identifying each row so you have some criteria to separate duplicates. If you have that, then you could use the "min(rowid)" suggestion.

Peter
------------------------------------------------------
Work smarter, not harder.
Reply With Quote