{"id":10578,"date":"2026-02-16T04:46:52","date_gmt":"2026-02-16T04:46:52","guid":{"rendered":"https:\/\/ubiq.co\/tech-blog\/?p=10578"},"modified":"2026-02-19T05:54:09","modified_gmt":"2026-02-19T05:54:09","slug":"mysql-remove-duplicate-records","status":"publish","type":"post","link":"https:\/\/ubiq.co\/tech-blog\/mysql-remove-duplicate-records\/","title":{"rendered":"How to Delete Duplicate Rows in MySQL"},"content":{"rendered":"\n<p>Sometimes your MySQL data tables may contain duplicate records. Removing duplicate rows is a common practice in data analysis and reporting. This is done to keep the data clean and avoid inaccuracies. Otherwise, they can give wrong results while doing aggregations and summaries. In this article, we will learn several different ways to delete duplicate rows in MySQL. Since we will be using plain SQL queries in most cases, you can also use most of these solutions for other databases also.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/ubiq.co\/tech-blog\/mysql-remove-duplicate-records\/#Why_Delete_Duplicate_Rows_in_MySQL\" >Why Delete Duplicate Rows in MySQL<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/ubiq.co\/tech-blog\/mysql-remove-duplicate-records\/#How_to_Delete_Duplicate_Rows_in_MySQL\" >How to Delete Duplicate Rows in MySQL<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/ubiq.co\/tech-blog\/mysql-remove-duplicate-records\/#1_Using_Row_Number\" >1. Using Row_Number<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/ubiq.co\/tech-blog\/mysql-remove-duplicate-records\/#2_Using_Intermediate_Table\" >2. Using Intermediate Table<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/ubiq.co\/tech-blog\/mysql-remove-duplicate-records\/#3_Using_DISTINCT_Keyword\" >3. Using DISTINCT Keyword<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/ubiq.co\/tech-blog\/mysql-remove-duplicate-records\/#4_Using_Group_By_Clause\" >4. Using Group By Clause<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/ubiq.co\/tech-blog\/mysql-remove-duplicate-records\/#5_Using_Having_Clause\" >5. Using Having Clause<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/ubiq.co\/tech-blog\/mysql-remove-duplicate-records\/#6_Using_Self-Join_Delete\" >6. Using Self-Join &amp; Delete<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/ubiq.co\/tech-blog\/mysql-remove-duplicate-records\/#Avoid_Inserting_Duplicate_Records\" >Avoid Inserting Duplicate Records<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/ubiq.co\/tech-blog\/mysql-remove-duplicate-records\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Why_Delete_Duplicate_Rows_in_MySQL\"><\/span>Why Delete Duplicate Rows in MySQL<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Duplicate data can cause a lot of problems in <a href=\"https:\/\/ubiq.co\/data-analysis-tool\">data analysis and reporting<\/a> systems. They can mess up row counts, totals, aggregations and summaries. They can also spoil data integrity and hurt its credibility. So it is important to identify and remove duplicate rows in MySQL database, before you process it any further. This is done during data preparation phase of analysis where we identify and remove records containing duplicates, nulls, empty values, incorrect data, etc. Thereafter, it is essential to put database constraints in place to prevent duplicate rows in data.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_Delete_Duplicate_Rows_in_MySQL\"><\/span>How to Delete Duplicate Rows in MySQL<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Here are the most common ways to delete duplicate rows in MySQL. Let us say you have the following sales table.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql&gt; create table sales(id int, product varchar(255),orders int);<br><br>mysql&gt; insert into sales(id,product,orders) values<br>        (1,'A',50),<br>        (2,'B',60),<br>        (3,'A',70),<br>        (4,'B',40),<br>        (5,'C',50),<br>        (1,'A',50),<br>        (4,'B',40);<br><br>mysql&gt; select * from sales;<br>+------+---------+--------+<br>| id   | product | orders |<br>+------+---------+--------+<br>|    1 | A       |     50 |<br>|    2 | B       |     60 |<br>|    3 | A       |     70 |<br>|    4 | B       |     40 |<br>|    5 | C       |     50 |<br>|    1 | A       |     50 |<br>|    4 | B       |     40 |<br>+------+---------+--------+<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_Using_Row_Number\"><\/span>1. Using Row_Number<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Since MySQL 8+, you can use row_number function within a common table expression (CTE). Row_number() function assigns sequential <a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-get-row-number-in-postgresql\/\">row number<\/a> within a partition of duplicates. Here is an example to find duplicate rows in MySQL table using row_number.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">WITH cte AS (<br>    SELECT <br>        *,<br>        ROW_NUMBER() OVER (<br>            PARTITION BY id,product,orders <br>            ORDER BY id<br>        ) AS row_num<br>    FROM <br>        sales<br>)<br>select * FROM cte WHERE row_num &gt; 1;        <\/pre>\n\n\n\n<p>In the above query, MySQL will partition table for unique combinations of id, product and orders column values. In each partition it will assign a unique sequential row number starting from 1. It will store the result in common table expression. If you have duplicate rows in a partition, their row number will be &gt;1. We select such rows from common table expression.<\/p>\n\n\n\n<p>If you want to delete duplicate rows, replace the SELECT * from &#8230; query with the following DELETE query.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">delete FROM cte WHERE row_num &gt; 1;   <\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Using_Intermediate_Table\"><\/span>2. Using Intermediate Table<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>This solution is suitable for large tables that contain many rows. When we call DELETE statement on a table, it has to scan all the rows in the table at least once, to delete duplicate rows. This can be time consuming, as the table size grows in size. In such cases, it is better to create a temporary table and copy unique rows from original table to this temp table. Then we delete the original table and rename temp table to original table. Lastly, we re-create any relations that were present in original table.<\/p>\n\n\n\n<p>Here is the query to create an empty temp_sales table that has the same structure like sales table.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">create table temp_sales like sales;<\/pre>\n\n\n\n<p>Next, we insert into temp_sales unique rows from sales table.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">insert into temp_sales select distinct * from sales;<\/pre>\n\n\n\n<p>Next, we drop sales table.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">drop table sales;<\/pre>\n\n\n\n<p>Lastly, we rename temp_sales table to sales.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">rename table temp_sales to sales;<\/pre>\n\n\n\n<p>If your original table contains any indexes, then you need to recreate them in your new table.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_Using_DISTINCT_Keyword\"><\/span>3. Using DISTINCT Keyword<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>You can use the DISTINCT keyword to return only unique rows in query result. Here is a sample query to get only distinct rows.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql&gt; select distinct * from sales;<br>+------+---------+--------+<br>| id   | product | orders |<br>+------+---------+--------+<br>|    1 | A       |     50 |<br>|    2 | B       |     60 |<br>|    3 | A       |     70 |<br>|    4 | B       |     40 |<br>|    5 | C       |     50 |<br>+------+---------+--------+<\/pre>\n\n\n\n<p>Please note, this will not alter the original table. Only the query result will contain unique rows. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"4_Using_Group_By_Clause\"><\/span>4. Using Group By Clause<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>GROUP BY clause is generally used to aggregate data by grouping rows by one or more columns. If the query does not contain any aggregation functions like sum(), min(), max(), etc. the GROUP BY clause will return the first row of each group, resulting in unique rows.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql&gt; select * from sales group by id, product, orders;<br>+------+---------+--------+<br>| id   | product | orders |<br>+------+---------+--------+<br>|    1 | A       |     50 |<br>|    2 | B       |     60 |<br>|    3 | A       |     70 |<br>|    4 | B       |     40 |<br>|    5 | C       |     50 |<br>+------+---------+--------+<\/pre>\n\n\n\n<p>Please note, this method also does not alter the original table.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"5_Using_Having_Clause\"><\/span>5. Using Having Clause<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The HAVING clause is generally used to filter the result of GROUP BY clause. Here is an example to select only those rows which have duplicates, that is, the row count in GROUP BY result &gt;1.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql&gt; select id, product, orders, count(*) <br>       from sales <br>       group by id, product, orders <br>       having count(*)&gt;1;<br>+------+---------+--------+----------+<br>| id   | product | orders | count(*) |<br>+------+---------+--------+----------+<br>|    1 | A       |     50 |        2 |<br>|    4 | B       |     40 |        2 |<br>+------+---------+--------+----------+<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"6_Using_Self-Join_Delete\"><\/span>6. Using Self-Join &amp; Delete<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>If your table has a unique primary key column with duplicate values for other columns, then you can simply do a self-join to identify the duplicate rows. Let us say you have the following sales table with id column as primary key, and duplicates in other columns.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">create table sales(id int, product varchar(255),orders int);<br><br>insert into sales(id,product,orders) values<br>        (1,'A',50),<br>        (2,'B',60),<br>        (3,'A',70),<br>        (4,'B',40),<br>        (5,'C',50),<br>        (6,'A',50),<br>        (7,'B',40);<\/pre>\n\n\n\n<p>You can easily filter the duplicate rows using the following inner join query.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">select * FROM sales t1<br>INNER JOIN sales t2 <br>WHERE <br>    t1.id &gt; t2.id AND <br>    t1.product = t2.product AND <br>    t1.orders = t2.orders;    <br><br>+------+---------+--------+------+---------+--------+<br>| id   | product | orders | id   | product | orders |<br>+------+---------+--------+------+---------+--------+<br>|    6 | A       |     50 |    1 | A       |     50 |<br>|    7 | B       |     40 |    4 | B       |     40 |<br>+------+---------+--------+------+---------+--------+<\/pre>\n\n\n\n<p>In the above query, we do an inner join and check for duplicates in product and orders column. For this, we check for equality in product and column values in the result of inner join. Thereafter, we filter only those rows where id (primary key) of left table is greater than that of right table.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Avoid_Inserting_Duplicate_Records\"><\/span>Avoid Inserting Duplicate Records<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Once you have identified and removed duplicate rows from your data, it is essential to add UNIQUE constraint or primary key to prevent insertion of duplicate rows in future. You can do this using the following SQL query on sales table.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ALTER TABLE sales ADD UNIQUE (order_id); <\/pre>\n\n\n\n<p>In the above example, we have set order_id column to be unique. You can add unique constraint for one or more columns.<\/p>\n\n\n\n<p>You can even name the constraint if you want.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ALTER TABLE sales ADD CONSTRAINT uniq_id UNIQUE (order_id); <\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>It is a common requirement to remove duplicate records in MySQL table, especially in data analysis and reporting systems where you need to clean up data before analyzing it. In this article, we have learnt several ways to remove duplicate records from table in MySQL. If you are using small-medium table, then you can use any of the above solutions but if you are working with large tables then it is recommended to use intermediate table (solution #3). Otherwise, it will take a lot of time to run queries.<\/p>\n\n\n\n<p>Also read:<br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-get-multiple-counts-in-single-query\/\">How to Get Multiple Counts in Single MySQL Query<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/top-5-online-resources-to-learn-mysql\/\">Top 5 Online Courses to Learn MySQL<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/mysql-select-top-n-rows-per-group\/\">MySQL Select Top N Rows Per Group<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Often database developers need to remove duplicate records from MySQL table. Here are different ways to delete duplicates rows in MySQL.<\/p>\n","protected":false},"author":1,"featured_media":10606,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[324],"tags":[628],"class_list":["post-10578","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mysql","tag-delete-duplicate"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Delete Duplicate Rows in MySQL - Ubiq BI<\/title>\n<meta name=\"description\" content=\"Often database developers need to remove duplicate records from MySQL table. Here are different ways to delete duplicates rows in MySQL.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ubiq.co\/tech-blog\/mysql-remove-duplicate-records\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Delete Duplicate Rows in MySQL - Ubiq BI\" \/>\n<meta property=\"og:description\" content=\"Often database developers need to remove duplicate records from MySQL table. Here are different ways to delete duplicates rows in MySQL.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ubiq.co\/tech-blog\/mysql-remove-duplicate-records\/\" \/>\n<meta property=\"og:site_name\" content=\"Ubiq BI\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ubiqbi\" \/>\n<meta property=\"article:published_time\" content=\"2026-02-16T04:46:52+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-02-19T05:54:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2026\/02\/remove-duplicate-mysql-table.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"242\" \/>\n\t<meta property=\"og:image:height\" content=\"161\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Sreeram Sreenivasan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@UbiqBI\" \/>\n<meta name=\"twitter:site\" content=\"@UbiqBI\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sreeram Sreenivasan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/mysql-remove-duplicate-records\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/mysql-remove-duplicate-records\\\/\"},\"author\":{\"name\":\"Sreeram Sreenivasan\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"headline\":\"How to Delete Duplicate Rows in MySQL\",\"datePublished\":\"2026-02-16T04:46:52+00:00\",\"dateModified\":\"2026-02-19T05:54:09+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/mysql-remove-duplicate-records\\\/\"},\"wordCount\":947,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/mysql-remove-duplicate-records\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2026\\\/02\\\/remove-duplicate-mysql-table.jpg?fit=242%2C161&ssl=1\",\"keywords\":[\"delete duplicate\"],\"articleSection\":[\"MySQL\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/mysql-remove-duplicate-records\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/mysql-remove-duplicate-records\\\/\",\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/mysql-remove-duplicate-records\\\/\",\"name\":\"How to Delete Duplicate Rows in MySQL - Ubiq BI\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/mysql-remove-duplicate-records\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/mysql-remove-duplicate-records\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2026\\\/02\\\/remove-duplicate-mysql-table.jpg?fit=242%2C161&ssl=1\",\"datePublished\":\"2026-02-16T04:46:52+00:00\",\"dateModified\":\"2026-02-19T05:54:09+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\"},\"description\":\"Often database developers need to remove duplicate records from MySQL table. Here are different ways to delete duplicates rows in MySQL.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/mysql-remove-duplicate-records\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/mysql-remove-duplicate-records\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/mysql-remove-duplicate-records\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2026\\\/02\\\/remove-duplicate-mysql-table.jpg?fit=242%2C161&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/ubiq.co\\\/tech-blog\\\/wp-content\\\/uploads\\\/2026\\\/02\\\/remove-duplicate-mysql-table.jpg?fit=242%2C161&ssl=1\",\"width\":242,\"height\":161,\"caption\":\"remove duplicate mysql table\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/mysql-remove-duplicate-records\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Delete Duplicate Rows in MySQL\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#website\",\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/\",\"name\":\"Ubiq BI\",\"description\":\"Build dashboards &amp; reports in minutes\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/#\\\/schema\\\/person\\\/db98d49a766a3a111d8510935ab90abc\",\"name\":\"Sreeram Sreenivasan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"caption\":\"Sreeram Sreenivasan\"},\"description\":\"Sreeram Sreenivasan is the Founder of Ubiq. He has helped many Fortune 500 companies in the areas of BI &amp; software development.\",\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/sreeram-sreenivasan\\\/\"],\"url\":\"https:\\\/\\\/ubiq.co\\\/tech-blog\\\/author\\\/wordpress\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Delete Duplicate Rows in MySQL - Ubiq BI","description":"Often database developers need to remove duplicate records from MySQL table. Here are different ways to delete duplicates rows in MySQL.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ubiq.co\/tech-blog\/mysql-remove-duplicate-records\/","og_locale":"en_US","og_type":"article","og_title":"How to Delete Duplicate Rows in MySQL - Ubiq BI","og_description":"Often database developers need to remove duplicate records from MySQL table. Here are different ways to delete duplicates rows in MySQL.","og_url":"https:\/\/ubiq.co\/tech-blog\/mysql-remove-duplicate-records\/","og_site_name":"Ubiq BI","article_publisher":"https:\/\/www.facebook.com\/ubiqbi","article_published_time":"2026-02-16T04:46:52+00:00","article_modified_time":"2026-02-19T05:54:09+00:00","og_image":[{"width":242,"height":161,"url":"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2026\/02\/remove-duplicate-mysql-table.jpg","type":"image\/jpeg"}],"author":"Sreeram Sreenivasan","twitter_card":"summary_large_image","twitter_creator":"@UbiqBI","twitter_site":"@UbiqBI","twitter_misc":{"Written by":"Sreeram Sreenivasan","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ubiq.co\/tech-blog\/mysql-remove-duplicate-records\/#article","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/mysql-remove-duplicate-records\/"},"author":{"name":"Sreeram Sreenivasan","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"headline":"How to Delete Duplicate Rows in MySQL","datePublished":"2026-02-16T04:46:52+00:00","dateModified":"2026-02-19T05:54:09+00:00","mainEntityOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/mysql-remove-duplicate-records\/"},"wordCount":947,"commentCount":0,"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/mysql-remove-duplicate-records\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2026\/02\/remove-duplicate-mysql-table.jpg?fit=242%2C161&ssl=1","keywords":["delete duplicate"],"articleSection":["MySQL"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ubiq.co\/tech-blog\/mysql-remove-duplicate-records\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ubiq.co\/tech-blog\/mysql-remove-duplicate-records\/","url":"https:\/\/ubiq.co\/tech-blog\/mysql-remove-duplicate-records\/","name":"How to Delete Duplicate Rows in MySQL - Ubiq BI","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/mysql-remove-duplicate-records\/#primaryimage"},"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/mysql-remove-duplicate-records\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2026\/02\/remove-duplicate-mysql-table.jpg?fit=242%2C161&ssl=1","datePublished":"2026-02-16T04:46:52+00:00","dateModified":"2026-02-19T05:54:09+00:00","author":{"@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"description":"Often database developers need to remove duplicate records from MySQL table. Here are different ways to delete duplicates rows in MySQL.","breadcrumb":{"@id":"https:\/\/ubiq.co\/tech-blog\/mysql-remove-duplicate-records\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ubiq.co\/tech-blog\/mysql-remove-duplicate-records\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ubiq.co\/tech-blog\/mysql-remove-duplicate-records\/#primaryimage","url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2026\/02\/remove-duplicate-mysql-table.jpg?fit=242%2C161&ssl=1","contentUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2026\/02\/remove-duplicate-mysql-table.jpg?fit=242%2C161&ssl=1","width":242,"height":161,"caption":"remove duplicate mysql table"},{"@type":"BreadcrumbList","@id":"https:\/\/ubiq.co\/tech-blog\/mysql-remove-duplicate-records\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ubiq.co\/tech-blog\/"},{"@type":"ListItem","position":2,"name":"How to Delete Duplicate Rows in MySQL"}]},{"@type":"WebSite","@id":"https:\/\/ubiq.co\/tech-blog\/#website","url":"https:\/\/ubiq.co\/tech-blog\/","name":"Ubiq BI","description":"Build dashboards &amp; reports in minutes","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ubiq.co\/tech-blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc","name":"Sreeram Sreenivasan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","caption":"Sreeram Sreenivasan"},"description":"Sreeram Sreenivasan is the Founder of Ubiq. He has helped many Fortune 500 companies in the areas of BI &amp; software development.","sameAs":["https:\/\/www.linkedin.com\/in\/sreeram-sreenivasan\/"],"url":"https:\/\/ubiq.co\/tech-blog\/author\/wordpress\/"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2026\/02\/remove-duplicate-mysql-table.jpg?fit=242%2C161&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/pbGGTT-2KC","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/10578","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/comments?post=10578"}],"version-history":[{"count":31,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/10578\/revisions"}],"predecessor-version":[{"id":10644,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/10578\/revisions\/10644"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media\/10606"}],"wp:attachment":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media?parent=10578"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/categories?post=10578"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/tags?post=10578"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}