title: Joining tables in SQL in one row
body: <p>I have the following table structure of my database:</p>
  
  <p><a href="https://i.stack.imgur.com/h033q.jpg" rel="nofollow noreferrer">db structure</a></p>
  
  <p>My aim is to output every row of tbl_Therapeuten (these are my employees) with the name of their trainings (in german "Fortbildung").
  The names of the trainings are stored in tbl_Forbildungen. And the trainings which each employee has is stores in tbl_Therapeut_Fortbildung. For the output I want to show the name of the training, not the id.
  Like this:</p>
  
  <p><a href="https://i.stack.imgur.com/k0cjQ.jpg" rel="nofollow noreferrer">output</a></p>
  
  <p>I am programming in C#, SQL Server.
  First I tried this:</p>
  
  <pre><code>string sSQL = "SELECT t.*, STRING_AGG(tf.Id_Fortbildung, ';') AS Fortbildungen " +
                "FROM tbl_Therapeuten t " +
                "FULL OUTER JOIN tbl_Therapeut_Fortbildung tf on t.Id = tf.Id_Therapeut ";
  </code></pre>
  
  <p>But this brings an error containing that I don't use tbl_Therapeuten.Id in an aggregate function or in a Group by clause.</p>
  
  <p>Next I tried this:</p>
  
  <pre><code>string sSQL = "SELECT t.Id, t.Nachname, STRING_AGG(tf.Id_Fortbildung, ';') AS Fortbildungen " +
                "FROM tbl_Therapeuten t " +
                "FULL OUTER JOIN tbl_Therapeut_Fortbildung tf on t.Id = tf.Id_Therapeut " +
                "GROUP BY t.Id, t.Nachname";
  </code></pre>
  
  <p>This worked (except displaying the name of the training but the Id) but I don't want to explicitly name every column of tbl_Therapeuten. I want to use "t.*". But this is not working:</p>
  
  <pre><code>string sSQL = "SELECT t.*, STRING_AGG(tf.Id_Fortbildung, ';') AS Fortbildungen " +
                "FROM tbl_Therapeuten t " +
                "FULL OUTER JOIN tbl_Therapeut_Fortbildung tf on t.Id = tf.Id_Therapeut " +
                "GROUP BY t.*";
  </code></pre>
  
  <p>So I need some help :)</p>
  
  <p>And what I also don't know how to do is to display the name of the trainings instead of the id.</p>
  
  <p>Thanks for your help!</p>