title: Multiple Group by in SQL
body: <p>I have a table like this.</p>
  
  <pre><code>Year        Month       TenDays     Pay    
  ========================================
  2015         8          2           12     
  2016         8          1           43
  2016         8          2           11
  2016         9          1           22
  2016         9          2           33
  2016         9          3           4
  2016         9          3           25
  </code></pre>
  
  <p>I want to have SQL query that calculate sum of 'Pay' as 'TotalTenDays' group by 'year' and 'Month' and 'TenDays'
  and also calculate sum of 'Pay' as 'TotalMonth' group by 'year' and 'Month'.</p>
  
  <p>I can do that with "union all" but <strong><em>I am searching for a way without using union and 'with cte as()'.</em></strong>
  Is it Possible?</p>
  
  <p>Expected table must be like this:</p>
  
  <pre><code>Year        Month       TenDays    TotalTenDays   TotalMonth
  ====================================================================
  2015         8          2          12             12
  2016         8          1          43             54
  2016         8          2          11             54
  2016         9          1          22             84
  2016         9          2          33             84
  2016         9          3          29             84
  </code></pre>