title: Find and remove duplicate rows by two columns
body: <p>I read all the relevant duplicated questions/answers and I found this to be the most relevant answer:</p>
  
  <pre><code>INSERT IGNORE INTO temp(MAILING_ID,REPORT_ID) 
  SELECT DISTINCT MAILING_ID,REPORT_IDFROM table_1
  ;
  </code></pre>
  
  <p>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.</p>
  
  <p>I tried to add all the relevant columns this way:</p>
  
  <pre><code>INSERT IGNORE INTO temp(M_ID,MAILING_ID,REPORT_ID,
  MAILING_NAME,VISIBILITY,EXPORTED) SELECT DISTINCT  
  M_ID,MAILING_ID,REPORT_ID,MAILING_NAME,VISIBILITY,
  EXPORTED FROM table_1
  ;
  
  
  M_ID(int,primary),MAILING_ID(int),REPORT_ID(int),
  MAILING_NAME(varchar),VISIBILITY(varchar),EXPORTED(int)
  </code></pre>
  
  <p>But it inserted all rows into temp (including duplicates)</p>