title: Stringify subquery results into main query
body: <p>Lets say I have two tables; students and classes.  Each students can have many classes.
  I would like to create a query that will print out every student in the following style:
  Column 1 the students name and column 2 a string of classes they are in ex "math, history, geology"
  I know how to query every student or query all classes but cant seem to wrap my mind around getting them to work together. The SQL used to create the string:   </p>
  
  <pre><code>DECLARE @classes VARCHAR(1000)
  SELECT @classes = COALESCE(@classes + ', ', '') + clss.name
  FROM
  (
  SELECT name
  FROM classes
  where student.id = 1
  )clss
  SELECT @classes
  </code></pre>