title: Count and list out unique combination by group
body: <p>I am wanting to derive a SQL that can bring me the following result, but I just can't seem to get my head around this particular scenario. </p>
  
  <p>I want to see how many individual combination of ROLE-combination by USER there are, and report the count and list out role-names. </p>
  
  <p>Here is the example table:</p>
  
  <pre><code>USER ROLE
  AAA  Report
  AAA  Enquiry
  AAA  Manager
  BBB  Report
  BBB  Enquiry
  BBB  Manager
  CCC  Enquiry
  CCC  Report
  DDD  Report
  EEE  Report
  EEE  Enquiry
  EEE  Admin
  FFF  Report
  FFF  Enquiry
  GGG  Report
  GGG  Enquiry
  GGG  Manager
  GGG  PAYROLL
  HHH  Report
  III  Report
  III  Enquiry
  </code></pre>
  
  <p>There are AAA, and BBB with role combination of "Report-Enquiry-Manager", therefore count of 2 recored. </p>
  
  <p>There is only CCC with Enquiry-Report. </p>
  
  <p>There are DDD and HHH with role of Report. </p>
  
  <p>Therefore, the desired output would be</p>
  
  <pre><code>COUNT   ROLE-COMBINATION
  2       Report-Enquiry-Manager
  3       Enquiry-Report
  2       Report
  1       Report-Enquiry-Admin
  1       Report-Enquiry-Manager-PAYROLL
  </code></pre>
  
  <p>Could someone point me to the right direction please. </p>
  
  <p>Thanks heaps,</p>