title: Getting values of comma separated fields in SQL Server
body: <p>I have comma separated column which represents the ids of cities like:</p>
  
  <pre><code>ID | Name
  1  | 1,2,3 
  2  | 2,3,4
  </code></pre>
  
  <p>I want to make query to get name of the this  value field. There is <code>City</code> Table which has two columns: id and name of cities </p>
  
  <p><strong>EXPECTED OUTPUT</strong></p>
  
  <pre><code>ID | VALUES    
  1  | mumbai,delhi,pune
  2  | delhi,pune,chennai
  </code></pre>
  
  <p>I can make a query if there is only one id in a column like:</p>
  
  <pre><code>select data.id,city.name from data,city where data.values=city.cityid
  </code></pre>
  
  <p>but I am not getting how to retrieve the data if there are multiple comma-separated values in one field.</p>