Поиск дубликатов в MySQL

· 44 words · 1 minute read

How to find duplicates in MySQL

case-insensitive collation (_ci):

select distinct
    md5(column) as hash, columncount(*) as c
from
    table
group by
    hash
having
    c > 1

binary collation (_bin):

select
    column, count(*) as c
from
    table
group by
    column
having
    c > 1