Find and remove duplicate rows by two columns
问题 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 DISTINCT MAILING_ID,REPORT_IDFROM table_1 ; The problem is that I want to remove duplicates by col1 and col2, but also want to include to the insert all the other fields of table_1. I tried to add all the relevant columns this way: INSERT IGNORE INTO temp(M_ID,MAILING_ID,REPORT_ID, MAILING_NAME,VISIBILITY,EXPORTED) SELECT DISTINCT M_ID