Find and remove duplicate rows by two columns

前端 未结 7 604
鱼传尺愫
鱼传尺愫 2021-02-01 08:52

I read all the relevant duplicated questions/answers and I found this to be the most relevant answer:

INSERT IGNORE INTO temp(MAILING_ID,REPORT_ID) 
SELECT DISTI         


        
7条回答
  •  -上瘾入骨i
    2021-02-01 09:24

    For Mysql:

    DELETE t1 FROM yourtable t1 
      INNER JOIN yourtable t2 WHERE t1.id < t2.id 
        AND t1.identField1 = t2.identField1 
        AND t1.identField2 = t2.identField2;
    

提交回复
热议问题