Concatenate Column A depending on Value of Column B - SQL Server : <pre><code>I have a table that looks like the following


COLUMN_A|| COLUMN_B ||
======================
NAME1   ||    1     ||
NAME2   ||    1     ||
NAME3   ||    1     ||  
NAME4   ||    2     ||  
NAME5   ||    2     ||  
NAME6   ||    3     ||
NAME7   ||    3     ||  
</code></pre>

<p>I want to concatenate COLUMN_A depending on COLUMN_B.
If values of COLUMN_B are same, then COLUMN_A should be concatenated seperated by a comma.</p>

<p>Expected result</p>

<pre><code>NAME1, NAME2, NAME3
NAME4, NAME5
NAME6, NAME7
</code></pre>
