title: Calculate new users subscription amount MySQL
body: <p>I have a dataset where I need to find out New subscribers revenue. </p>
  
  <p>These are subscribers that are paying either weekly or monthly depending on the subscription they are on.</p>
  
  <p>The unique identifier is "customer" and the data is at timestamp level, but I want it rolled up at monthly level.</p>
  
  <p>Now for each month, we need to find out revenue for only NEW subscribers.
  Basically, imagine customers being on monthly/weekly subscriptions and we only want their FIRST Payments to be counted here.</p>
  
  <p>Here's a sample dataset and </p>
  
  <pre><code>created            customer                  amount
  16-Feb-18 14:03:55  cus_BwcisIF1YR1UlD  33300
  16-Feb-18 14:28:13  cus_BpLsCvjuubYZAe  156250
  15-Feb-18 19:19:14  cus_C3vT6uVBqJC1wz  50000
  14-Feb-18 23:00:24  cus_BME5vNeXAeZSN2  162375
  9-Feb-18 14:27:26   cus_BpLsCvjuubYZAe  156250
  </code></pre>
  
  <p>....and so on...</p>
  
  <p>here is the final desired output</p>
  
  <pre><code>yearmonth new_amount
  Jan - 2018   100000
  Feb - 2018   2000
  Dec - 2017   100002
  </code></pre>
  
  <p>This needs to be done in MySQL interface. </p>