Find duplicate records in MySQL

后端 未结 23 3220
别跟我提以往
别跟我提以往 2020-11-21 23:12

I want to pull out duplicate records in a MySQL Database. This can be done with:

SELECT address, count(id) as cnt FROM list
GROUP BY address HAVING cnt >         


        
23条回答
  •  执笔经年
    2020-11-21 23:43

    we can found the duplicates depends on more then one fields also.For those cases you can use below format.

    SELECT COUNT(*), column1, column2 
    FROM tablename
    GROUP BY column1, column2
    HAVING COUNT(*)>1;
    

提交回复
热议问题