title: MySQL query to concatenate all the values in each row based on the common same id matching
body: <p>Is there any way to concatenate the value in a field that matching with a common field say userid.</p>
  
  <p>For eg if this is the table,</p>
  
  <pre><code>UserID | Field1 | Field2
  1      | aaa    | zzz
  1      | bbb    | yyy
  1      | ccc    | xxx
  </code></pre>
  
  <p>i want it as a single row like</p>
  
  <pre><code>UserID | Field1        | Field2
  1      | aaa, bbb, ccc | zzz, yyy, xxx
  </code></pre>
  
  <p>Thanks</p>