This command adds a unique key, and drops all rows that generate errors (due to the unique key). This removes duplicates.
ALTER IGNORE TABLE table ADD UNIQUE KEY idx1(title);
Edit: Note that this command may not work for InnoDB tables for some versions of MySQL. See this post for a workaround. (Thanks to “an anonymous user” for this information.)
Related Contents:
- Remove duplicate rows in MySQL
- Delete all Duplicate Rows except for One in MySQL? [duplicate]
- Find duplicate records in MySQL
- How to delete duplicates on a MySQL table?
- How to abort INSERT operation in MySql trigger?
- Prevent auto increment on MySQL duplicate insert
- Deleting duplicate rows from a table
- MySQL delete duplicate records but keep latest
- How do I delete all the duplicate records in a MySQL table without temp tables
- In MySQL, can I copy one row to insert into the same table?
- Removing duplicates with unique index
- Force MySQL to return duplicates from WHERE IN clause without using JOIN/UNION?
- How to delete duplicate rows from a MySQL table
- How can I search (case-insensitive) in a column using LIKE wildcard?
- How to find similar results and sort by similarity?
- Using variable in a LIMIT clause in MySQL
- mysql select dynamic row values as column names, another column as value
- MySQL Split Comma Separated String Into Temp Table
- SQL Performance UNION vs OR
- Mysql order by specific ID values
- Is the primary key automatically indexed in MySQL?
- MySQL autoincrement column jumps by 10- why?
- MySQL: Fastest way to count number of rows
- How to export SQL Server database to MySQL? [duplicate]
- ERROR 1130 (HY000): Host ” is not allowed to connect to this MySQL server [duplicate]
- MySQL user DB does not have password columns – Installing MySQL on OSX
- MySQL – length() vs char_length()
- Mysql string split [duplicate]
- What are the differences between utf8_general_ci and utf8_unicode_ci? [duplicate]
- How to create relationships in MySQL
- Pass array to MySQL stored routine
- How do I use on delete cascade in mysql?
- How to get the next auto-increment id in mysql
- MySQL variable format for a “NOT IN” list of values
- How to subtract hours from a datetime in MySQL?
- Order by COUNT per value
- Why does MySQL autoincrement increase on failed inserts?
- What is the MySQL query equivalent of PHP strip_tags?
- MySQL Group By and Sum total value of other column
- Mysql Improve Search Performance with wildcards (%%)
- Facebook like notifications tracking (DB Design)
- #1273 – Unknown collation: ‘utf8mb4_unicode_ci’ cPanel
- How to set root password to null
- What is the best MySQL collation for German language
- Use Composite Primary Key as Foreign Key
- What resources exist for Database performance-tuning? [closed]
- NodeJS responded MySQL timezone is different when I fetch directly from MySQL
- Bind address and MySQL server [closed]
- How to transpose rows to columns with large amount of the data in BigQuery/SQL?
- How to drop all tables from the database with manage.py CLI in Django?