title: SQL Server 2012 - A Little Guidance
body: <p>I have searched the net but I am certain I must not be phrasing my keywords correctly because I am not finding possible solutions for my problem.   think it might be recursion but I'm not quite certain.</p>
  
  <p>I have a table that has the following categories:</p>
  
  <pre><code>ID, Author, Customer, Group
  </code></pre>
  
  <p>A sample dataset would be like:</p>
  
  <pre><code>  ID |      Author    | Customer  | Group
  ------------------------------------------ 
     1 |  Paula Hawkins | John Doe  | NULL
     2 |  Harlan Coben  | John Doe  | NULL
     3 | James Patterson| John Doe  | NULL    
     4 |  Paula Hawkins | Jane Doe  | NULL    
     5 | James Patterson| Jane Doe  | NULL
     6 | James Patterson| Steven Doe| NULL    
     7 |  Harlan Coben  | Steven Doe| NULL
     8 |  Paula Hawkins | Harry Doe | NULL    
     9 | James Patterson| Harry Doe | NULL
  </code></pre>
  
  <p>Its possible a customer may have one ore more then one author checked out so what I am trying to do is group them with a unique id based on what total are checked out (regardless of the customer name):</p>
  
  <pre><code> ID  |      Author    |  Customer  | Group
  --------------------------------------------   
    1  |  Paula Hawkins |  John Doe  |   1    
    2  |  Harlan Coben  |  John Doe  |   1
    3  | James Patterson|  John Doe  |   1
    4  |  Paula Hawkins |  Jane Doe  |   2    
    5  | James Patterson|  Jane Doe  |   2    
    6  | James Patterson| Steven Doe |   3    
    7  |  Harlan Coben  | Steven Doe |   3    
    8  |  Paula Hawkins |  Harry Doe |   2    
    9  | James Patterson|  Harry Doe |   2
  </code></pre>
  
  <p>its very possible the same customer could be found hundreds of times for multiple books so the final group category would represent the unique value for that customer (other customers would have the same value only if everything they have checked out also matches everything the other customer has checked out).</p>
  
  <p>Using the above data, Harry and Jane have the exact same authors checked out so they are in the same group but John and Steven have different combinations so they have their own unique group.  </p>
  
  <p>Hopefully this makes sense.  Is this what is called recursion?  If so then I will look towards a cte solution that uses some sort of ranking for the unique id value.  Thanks for any help you give.</p>