title: How to convert columns data in comma separated list
body: <p>I am in little strange situation. It is a third party application which from front end doesn't allow user procedures or udf/scalar functions to be called. </p>
  
  <p>Only option is to write SQL and below is how my data looks. <strong><em>First pic has a mistake last PID was suppose to be 1 and second last 2.</em></strong> </p>
  
  <p><img src="https://i.stack.imgur.com/e8ATp.png" alt="enter image description here"></p>
  
  <p>What I need it to be is this,</p>
  
  <p><img src="https://i.stack.imgur.com/QVkwt.png" alt="enter image description here"></p>
  
  <p>This can be easily done using UDF/cursor in this Advantage Database Server 9 but I don't have a choice. I don't know if it is really possible. In Sybase there exist a function called list which does this sort of work very easily but not sure here. </p>
  
  <p>Application does allow to call built in functions. </p>