title: How to get a list of customers that stopped paying this month based on last month payments?
body: <p>I have a table with the following structure :</p>
  
  <pre><code>payments
   - id
   - created
   - amount
   - customer_id
  </code></pre>
  
  <p>This table contains values like :</p>
  
  <pre><code>'2016-12-03', 100, 1,
  '2016-12-10',  50, 2,
  '2016-12-23', 130, 3,
  
  '2017-01-03', 100, 1,
  '2017-01-11',  25, 4,
  '2017-01-12',  50, 2,
  '2017-01-24',  10, 3,
  '2017-01-24',  25, 4,
  
  '2017-02-03', 100, 1,
  '2017-02-03',  25, 4,
  
  '2017-03-03', 100, 1
  </code></pre>
  
  <p>(I've space the data for a better view, by months)</p>
  
  <p>With those data in mind, I'm trying to build a MySQL query that would return me the customers that paid only once per month (aka subscriptions), at least two months, but that haven't paid the last month (up to 2017-02-03 as of today, but <code>(UTC_DATE() - INTERVAL 1 MONTH)</code> in MySQL) (since March hasn't ended yet).</p>
  
  <p>Using the above data, it would return <code>customer_id</code> 2 and 3, but I don't have a clue how to do it.</p>
  
  <p>Please note that I'm also trying to do it on a rolling month basis (March is included up to today)</p>
  
  <p>If it may help, the global idea is to get the customers that have stopped paying a recurring monthly payment.</p>
  
  <p>I've made an <a href="http://sqlfiddle.com/#!9/570601" rel="nofollow noreferrer">SQLFiddle</a> to help.</p>