title: JOIN three tables and aggregate data from multiple rows for every DISTINCT row in separate column
body: <p>JOIN three tables and aggregate data from multiple rows for every DISTINCT row in separate column</p>
  
  <p>i have a table where one item is mapped with multiple items.</p>
  
  <pre><code>Key 1 | Key 2
  1       2
  1       5
  1       6
  1       4
  1       8
  </code></pre>
  
  <p>I have another table like this</p>
  
  <pre><code>Key 1 | ShortKey1Desc
  1       'Desc short'
  </code></pre>
  
  <p>i have one more table where i have data like this</p>
  
  <pre><code>Key 1 | Description
  1       'Desc a'
  1       'Desc c'
  1       'Desc aa'
  1       'Desc tt'
  </code></pre>
  
  <p>i need to write a sql query for my view where table would be generated like this</p>
  
  <pre><code>Key 1 | AllKeys2ForKey1 | AllDescriptionsForKey1           | ShortKey1Desc
  1     | 2;5;6;4;8       | Desc a; Desc c; Desc aa; Desc tt | Desc short
  </code></pre>
  
  <p>Key 1 is a string type field so i need to join them table using that string key</p>
  
  <p>what i'm trying is to create a view for comfortable data access. need to create a query what will not take ages. i already tried to do it with Functions but it takes ages for load.</p>
  
  <p>any help on this one would be highly appreciated. thanks a lot</p>