title: Remove one of duplicate records
body: <p>This is my DB table table name is <code>food_user</code>. I use mariadb version 10.1.38.</p>
  
  <p><img src="https://i.stack.imgur.com/fHHSy.png" alt="enter image description here"></p>
  
  <p>I run the following sql query :</p>
  
  <pre><code>INSERT INTO food_user (NAME,re_date,re_day)
  SELECT 'Alex','2019-01-01' + INTERVAL seq DAY,DAYNAME('2019-01-01' + INTERVAL seq DAY)
  FROM seq_0_to_364; 
  </code></pre>
  
  <p>two times. So there are two data of the same date as seen on the screenshot below.</p>
  
  <p><img src="https://i.stack.imgur.com/0mwCF.png" alt="enter image description here"></p>
  
  <p>I'd like to remove one of the two same dates.</p>
  
  <p>I try this query. </p>
  
  <pre><code>DELETE n1 from food_user n1, food_user n2 
  where n1.id &gt; n2.id
    and n1.sum=0 and n2.sum=0
    and n1.name='Alex'
    and n2.name='Alex'
    and n1.re_date=?
    and n2.re_date=?;
  </code></pre>
  
  <p>I don't know the proper query.</p>