title: Assign Numbers to Groups in Calculated Column SQL Server
body: <p>This is probably extremely easy however for some reason I am having difficulty in pinpointing exactly how to do this. I have a list of names and cities associated with those names. I want to assign a number in a calculated column based on 1) name and 2) city. Example code below:</p>
  
  <pre><code>Name       |       City      |   Calculated Column
  John               NYC                 1
  John               NYC                 1
  John               NYC                 1
  John                LA                 2
  John                LA                 2
  Chris              NYC                 1
  Chris               SF                 2
  Christ              SF                 2 
  Chris               LA                 3
  </code></pre>
  
  <p>I am assuming I need to use an over and partition function, but have not been able to properly calculate the 'Calculated Column' above. Any assistance would be greatly appreciated. Thanks so much in advance!</p>