title: Data Matching with SQL and assigning Identity ID's
body: <p>How to write a query that will match data and produce and identity for it.</p>
  
  <p>For Example:</p>
  
  <pre>
  RecordID | Name
  1        | John
  2        | John
  3        | Smith
  4        | Smith
  5        | Smith
  6        | Carl
  </pre>
  
  <p>I want a query which will assign an identity after matching exactly on Name.</p>
  
  <p>Expected Output:</p>
  
  <pre>
  RecordID | Name  | ID
  1        | John  | 1X
  2        | John  | 1X
  3        | Smith | 1Y
  4        | Smith | 1Y
  5        | Smith | 1Y
  6        | Carl  | 1Z
  </pre>
  
  <p>Note: The ID should be unique for every match. Also, it can be numbers or varchar.</p>
  
  <p>Can somebody help me with this? The main thing is to assign the ID's. </p>
  
  <p>Thanks.</p>