问题描述:

I had heavy SQL dump of a table. I used bigdump lib to import it in MySql database on my server.

Although it worked fine, but now I have duplicated entries in that table.

same table on local server has 8 * 105 records but on server it has 15 * 105 records.

Can you suggest me a query to delete duplicate entries from this table?

Here is my table structure.

Table name is : techdata_products

P.S. This table does not have any primary key.

网友答案:

SQL is not my strong point but I think you can export the result of this query:

SELECT DISTINCT * FROM table;

And then, create a new table and import your results.

网友答案:

First starters why do you have no primary key? You could have simply made that id field that auto increments a primary key to prevent duplicates. My suggestion would be to create a new table and do a

Select Distinct * from table and put the results into a new table that has a primary key

相关阅读:
Top