Connecting Tech Pros Worldwide Forums | Help | Site Map

Duplicate Entries

OuTCasT's Avatar
Needs Regular Fix
 
Join Date: Jan 2008
Location: South Africa
Posts: 360
#1: Feb 20 '09
I have a table with duplicated entries. How could i return the single rows of each record so i can get rid of the duplicates. Or how do i remove duplicate entry rows ?

gpl gpl is offline
Member
 
Join Date: Jul 2007
Posts: 34
#2: Feb 20 '09

re: Duplicate Entries


It all depends what you mean by duplicate
If you mean that there are several - but not all - columns that hold duplicate values, then you can use the non duplicate columns to uniquely identify the rows that you want to delete
However - if you have 2 or more rows with exactly the same content, then there is no way to distinguish between them, your only solution there is to store the values, delete all the rows with those values and then reinsert the row.
ck9663's Avatar
Expert
 
Join Date: Jun 2007
Posts: 1,925
#3: Feb 20 '09

re: Duplicate Entries


Or you can use DISTINCT keyword on your select.

Here's the complete syntax.


-- CK
Reply