title: SQL - retention rate (year 2 volume/year 1 volume), compared across offices
body: <p>I need to get the average volume retention rate, (year 2 volume/year 1 volume), and compared by offices.</p>
  <p>My tables look like;</p>
  <p>Payments</p>
  <pre><code>payment_id  STRING  NULLABLE    
  account_number  STRING  NULLABLE    
  payment_ordered_on  DATETIME    NULLABLE    
  payment_currency    STRING  NULLABLE    
  payment_amount  FLOAT   NULLABLE    
  gbp_payment_amount  FLOAT   NULLABLE
  </code></pre>
  <p>accounts</p>
  <pre><code>account_number  STRING  NULLABLE    
  country STRING  NULLABLE    
  client_type STRING  NULLABLE
  </code></pre>
  <p>I think that I need to calculate the volume for each office for each year and then divide the last one by the previous one, any help is kindly appreciated.</p>