title: Select rows from a database and sum/group by
body: <p>I'm currently struggling with the logic for this SQL Statement.</p>
  
  <p>I have a single table with columns containing:</p>
  
  <pre><code>Country, Customer, Year, Product Purchased( 5 different products) and Revenue.
  </code></pre>
  
  <p>I'm looking to write a select statement that pulls through the Country, Customer Name, each Product Purchased, Revenue for each product for the customer in each year.</p>
  
  <pre><code>SELECT Country, Customer, Year, Product, Revenue
  FROM table
  GROUP BY Country, Customer, Year, Product Purchased, Revenue
  </code></pre>
  
  <p>Country Customer Year Product Revenue Total Revenue
  England Customer A 2017 Product A 100 200
  England Customer A 2017 Product B 100 200
  England Customer A 2016 Product A 100 100
  Can anyone help please? </p>