Find duplicates in the same table in MySQL

后端 未结 13 1902
感动是毒
感动是毒 2020-12-10 02:03

I have a table with two columns - artist, release_id

What query can I run to show duplicate records?

e.g. my table is

ArtistX : 45677
ArtistY         


        
13条回答
  •  春和景丽
    2020-12-10 02:26

    you can try something like this

    select artist, count(*) from mytable group by artist having count(*) > 1;
    

    wich would output

    artist   count(*)
    45677    2
    378798   2
    

提交回复
热议问题