title: SQL, How to Concatenate results?
body: <p>I currently have a SQL query that returns a number of fields. I need one f the fields to be effectively a sub query sub that.</p>
  
  <p><strong>The Problem in detail:</strong></p>
  
  <blockquote>
    <p>If I have a table X with two columns, ModuleID and say ModuleValue, how can I write a SQL query to take the results and Concatenate it into one field:</p>
  </blockquote>
  
  <p><strong>EG</strong> Results returned from  </p>
  
  <pre><code> (SELECT ModuleValue FROM Table_X WHERE ModuleID=@ModuleID)
  </code></pre>
  
  <p>Value 1</p>
  
  <p>Value 2</p>
  
  <p>Value 3</p>
  
  <p>...</p>
  
  <p>I need to return the result thus (as a single row, unlike the above):</p>
  
  <blockquote>
    <p>Value 1, Value 2, Value 3</p>
  </blockquote>
  
  <p>Is there a simple Concatenation method that could be user?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <blockquote>
    <p>DB is MS TSQL (2005)</p>
  </blockquote>