title: Join multiple rows from Table 2 into separate columns when selecting data based on ID linked to table 1?
body: <p>I may have the incorrect database design, but I have an issue as follows:</p>
  
  <pre><code>    +-----------+        +------------+-----------+
      |  table1   |        |         table2         |
      +-----------+        +------------+-----------+
      | Type      |        | Type       | Item      |
      | Fruit     |        | Fruit      | Apple     |
      | Vegetable |        | Fruit      | Orange    |
      +-----------+        | Fruit      | Pear      |
                           | Vegetable  | Zucchini  |
                           +------------+-----------+
  </code></pre>
  
  <p>I would like to query my DB to return something that looks like this:</p>
  
  <pre><code>+-------------+----------+----------+---------+
  |     Result  |          |          |         |
  +-------------+----------+----------+---------+
  | Type        | Result1  | Result2  | Result3 |
  | Fruit       | Apple    | Orange   | Pear    |
  +-------------+----------+----------+---------+
  </code></pre>
  
  <p>When I query items based on the "Fruit" ID. My current query will return a row for each, but I'd like to turn these rows into separate columns in the results table.</p>
  
  <p>I've looked around into using different types of joins and group_concat, but I don't think any of these are explicitly appropriate as a solution by itself. I'm a bit of an SQL rookie so I'm having trouble on knowing "what" to look for.</p>
  
  <pre><code>SELECT t1.Type, t2.item,
  FROM table1 as t1, table2 as t2
  WHERE t2.Type="Fruit";  
  </code></pre>
  
  <p>I understand that this will return each iteration of the results, but is not what I want.</p>