[MySQL]Delete duplicates in a table

Last update on July 20, 2009 08:53 AM by jak58
Published by jak58

[MySQL]Delete duplicates in a table







To remove duplicates in a table set up as follows:

CREATE TABLE IF NOT EXISTS TabTest (   
           prim_key integer(4) NOT NULL auto_increment,
           x integer,
           y integer,
           z integer,
           Constraint pk_Tab_test PRIMARY KEY  (rpim_key)    
); 


We should begin by setting the fields related to duplicate (in our case the fields x and y):



To remove duplicate fields in x and y run the command:
ALTER IGNORE TABLE  TabTest ADD UNIQUE INDEX(x,y);
Best answers for « Delete duplicates in a table » in :
Delete duplicates in an Excel column Show Delete duplicates in an Excel column To remove duplicates in an Excel column: Click on the Data menu Filter Advanced Filter In this menu, select the column where the duplicates Check the box "Extract without duplication"...
Avoid duplicates in Excel Show Avoid duplicates in Excel In order to avoid duplication when encoding in a column from an excel sheet: take the conditional format on the first cell under the headings (eg A2) choose the following formula:...
Excel How to extract partial data? ShowExcel How to extract partial data? Issue Solution Note Issue I have an Excel spreadsheet that contains around 1500 html links. All the addresses start out common... i.e. http://www.frogs.com/. What I want to extract into another...
DUPLICATE ENTRY '127' FOR KEY 1 ShowDUPLICATE ENTRY '127' FOR KEY 1 If you are using MySQL and you are facing the error “duplicate entry ‘127’ for key 1” while trying to make an entry in your database table, do not panic. This should be linked to the following and can easily...
How to know who blocked/deleted you on MSN ShowHow to know who blocked/deleted you on MSN There are many websites that claim to be able to confirm if a contact on your list has blocked you or not. These so-called block checkers do this by detecting the public status of the user who...
Download Auslogics Duplicate File Finder ShowAuslogics Duplicate File Finder is a utility to look for and delete duplicate files on your computer. Any daily computer activity accumulates automatically duplicate files on your PC, especially if you are an active user. Auslogics Duplicate File...
Download Microangelo Toolset ShowToolset is an icon editor for all Windows platforms including Windows Vista and XP. Toolset includes four integrated components which work together, which allows it to view, localize, extract, replace the icons, delete duplicate icons and handle...