SQL group by and cross apply
<pre><code>  id |    systemName | Systemid      
-------------------------------  
  100 |   A100  |       1  
  100 |   B100  |       2  
  100 |   C100  |       3  
  100 |   D100  |       4  
  200 |   A100  |       1  
  200 |   B200  |       2  
</code></pre>

<p>What is the best way to achieve the below result? Column System name should have the comma separated values of counted systems   </p>

<pre><code>id       Systemidcount   SystemName  
 ---------------------------------------------  
 100  |    4  |            A100,B100,C100,D100  
 200  |    2  |           A100,B200  
</code></pre>

<p>I am not able to format it correctly for some reason, apologies</p>