title: SQL concatenate text fields from different records in the same file
body: <p>Were talking about data in a file on an iSeries here using DB2. </p>
  
  <p>File structure is as such:</p>
  
  <pre><code>Item     Textline    Text
  
  12755    1           this item
  12755    2           is no longer
  12755    3           for sale
  abc123   1           please use
  abc123   2           another code
  xyz987   1           obsolete
  </code></pre>
  
  <p>The result im trying to get is</p>
  
  <pre><code>   Item     Text
  
     12755    this item is no longer for sale
     abc123   please use another code
     xyz987   obsolete
  </code></pre>
  
  <p>So it is grouped by Item code and the text lines are added up regardless of how many there are.</p>
  
  <p>I tried it in query first by joining the file to itself 5 times (there can be as many as 5 text lines) but i could never get it to work.</p>
  
  <p>I tried it in SQL but i cant get the commands im familair with to work correctly with text and im struggling on the criteria to add them together without duplicating the text lines up. </p>
  
  <p>Anyone any idea's ?</p>
  
  <p>My last resort is to extract this file 5 times over itself with each file just containing a different text line and then matching them all back together based on item and concatenating that way... but wow how messy that is :)</p>
  
  <p>Please help :)</p>