Find and remove duplicates: Difference between revisions
Jump to navigation
Jump to search
→Find duplicates in MySQL
| Line 36: | Line 36: | ||
== Find and remove duplicates in MySQL == | == Find and remove duplicates in MySQL == | ||
=== Find duplicates in MySQL === | === Find duplicates in MySQL === | ||
==== Finding duplicate value that differ in one column ==== | |||
Finding duplicate value that differ in one column<ref>[http://stackoverflow.com/questions/688549/finding-duplicate-values-in-mysql?rq=1 Finding duplicate values in MySQL - Stack Overflow]</ref> | Finding duplicate value that differ in one column<ref>[http://stackoverflow.com/questions/688549/finding-duplicate-values-in-mysql?rq=1 Finding duplicate values in MySQL - Stack Overflow]</ref> | ||
<pre> | <pre> | ||
| Line 101: | Line 102: | ||
MySQL: find the number of duplicate occurrence between list_a & list_b which using the same primary key: column name {{kbd | key = id}} | MySQL: find the number of duplicate occurrence between list_a & list_b which using the same primary key: column name {{kbd | key = id}} | ||
* {{kbd | key = SELECT count(DISTINCT(`id`)) FROM `list_a` WHERE `id` IN (SELECT DISTINCT(`id`) FROM `list_b`) ; }} | * {{kbd | key = SELECT count(DISTINCT(`id`)) FROM `list_a` WHERE `id` IN (SELECT DISTINCT(`id`) FROM `list_b`) ; }} | ||
=== Remove duplicates in MySQL === | === Remove duplicates in MySQL === | ||