title: SQL Group column data from joins
body: <p>I need some help with writing SQL query.</p>
  
  <p>I've data in the following format coming from a query returned by joining multiple tables.</p>
  
  <pre><code>CustID  Name    AccNo       Bank
  ------  ----    -----       -----
   1      Varun   9848032919    CB
   1      Varun   9998887771   COB
   1      Varun   9988776655    CB
   2      Lokesh  9876543210   COB
   2      Lokesh  9282726252    CB
   3      aaaa    9181716151   COB
  </code></pre>
  
  <p>I would like the data to be formatted as below so that it would be easy to load into Crystal reports.</p>
  
  <pre><code>CustID  Name               AccNo                      Bank
  ------  ----               -----                      -----
    1     Varun   9848032919,9998887771,9988776655      CB,COB,CB
    2     Lokesh  9876543210,9282726252                 COB,CB
    3     aaaa    9181716151                            COB
  </code></pre>
  
  <p>I've looked at other answers which suggest using STUFF, XML PATH() but they are applicable only if data comes from one table. In my scenario data is retrieved by joining multiple tables.</p>
  
  <p>May I know how to group by <code>CustID</code> and concatenate data in other columns as I desire?</p>
  
  <p>Thanks a lot for your time!!!</p>
  
  <p>EDIT: I'm looking for a SQL Server 2005 version answer</p>