title: How to get value based on position of special character string in a column
body: <p>I have a table like this </p>
  
  <pre><code>Col1                    Col2
  Adam                    1
  Barbara, Catherina      1
  Barbara, Catherina      2
  Adam, Catherina         1
  Adam, Catherina         2
  Barbara, Adam, Daniela  1
  Barbara, Adam, Daniela  2
  Barbara, Adam, Daniela  3
  </code></pre>
  
  <p>Need a select statement to populate Col3 like shown below</p>
  
  <pre><code>Col1                   Col2 Col 3
  Adam                    1   Adam
  Barbara, Catherina      1   Barbara
  Barbara, Catherina      2   Catherina
  Adam, Catherina         1   Adam
  Adam, Catherina         2   Catherina
  Barbara, Adam, Daniela  1   Barbara
  Barbara, Adam, Daniela  2   Adam
  Barbara, Adam, Daniela  3   Daniela
  </code></pre>
  
  <p>I tried using <code>SUBSTRING</code> &amp; <code>CHARINDEX</code> but was not able to find the solution. Need a query where we can pass Col2 value and populate Col3.</p>