title: DELETE query to destroy all but most recent and every first record every month within group of records
body: <p>I would like to create an <code>SQL DELETE</code> query that in one statement deletes all but:</p>
  
  <ul>
  <li>the most recent record</li>
  <li>and all but first record each previous month</li>
  </ul>
  
  <p>within a group of records. I made an SQL fiddle example here: <a href="http://www.sqlfiddle.com/#!15/2272a" rel="nofollow noreferrer">http://www.sqlfiddle.com/#!15/2272a</a></p>
  
  <p>The result of the delete should be, that from the group og records (records having <code>other_table_id = 1</code>), the only ones left should be:</p>
  
  <pre><code>('2017-01-02', 1), 
  ('2017-03-24', 1),
  ('2017-04-03', 1), 
  ('2017-05-24', 1),
  ('2017-12-14', 1)
  </code></pre>
  
  <p>Is this at all possible to do in one query or do I need to do it in multiple ones?</p>