title: Rolling up multiple rows into a single row and column for SQL Server data
body: <p>I want is put the multilpe rows in a single row and column and I'm using MICROSOFT SQL Server. I tried the stuff command but I getting the error The multi-part identifier "" could not be bound. Please Help! Thanks</p>
  
  <pre><code>select a.CLAIMNO, e.INVNO, d.MSISDN, a.BATCHNO, b.CUSTOMER, b. PRODNO, 
  b.INCENTIVE, b.QTY, b.STATUS, 
  b.ROWNUM, b.RECEIVEDBY, b.RECEIVEDDATE, b.REMARKS, b.PESOVALUE
  from CSPC_CLAIMHDR a
  left join CSPC_CLAIMDTL b on a.PRFNO = b.PRFNO and a.CLAIMNO = b.CLAIMNO 
  left join CSPC_CUSTOMERS c on c.CUSTNAME = b.CUSTOMER 
  left join CSPC_PMACCOUNT d on d.CUSTCODE = c.CUSTCODE 
  left join CSPC_INVOICEHDR e on e.CLAIMNO = a.CLAIMNO
  where upper(a.PRFNO) = 'MOM--0108' and b.INCENTIVE not like '%POINTS%' and 
  a.APPROVEDBY is not null order by b.CUSTOMER
  </code></pre>
  
  <p>this produces 
  [Result][1]</p>
  
  <pre><code>CLAIMNO   INVNO 
  618       SO202
  618       SO213
  618       SO932
  618       SO133
  618       SO873
  658       SO123
  658       SO877
  </code></pre>
  
  <p>and I want it to produce it like this below.</p>
  
  <pre><code>CLAIMNO   INVNO
  618       SO202,SO213,SO932,SO133,SO873
  658       SO123,SO877
  </code></pre>