O
O
Ord EO2020-02-16 13:26:49
MySQL
Ord EO, 2020-02-16 13:26:49

How to find complete duplicate rows in MySQL table?

There is a table with about half a million rows of records in MySQL. The table has about 10 columns, the first id is the rest of different data types. How can you find absolute duplicate rows (not counting id's) among all this data?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
coderisimo, 2020-02-16
@coderisimo

//f1, f2 - все поля  по которым ищем дубликаты
SELECT f1, f2, COUNT( f1) AS cnt
FROM table
GROUP BY f1, f2
HAVING (cnt > 1)

K
Konstantin Tsvetkov, 2020-02-16
@tsklab

Calculate the hash of the sum of the string representations of the delimited columns without ID.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question