title: Difficulty with Pivot in sql
body: <p>I have two tables, <code>title</code> and <code>territory</code>. Territory tells me where the title is available:</p>
  
  <pre><code>`title`
  - id
  - name
  
  `territory`
  - title_id (FK)
  - territory
  </code></pre>
  
  <p>I want the output to look like this:</p>
  
  <pre><code>id      name     territory     territory     territory     etc...
  1       Titanic  US            GB            FR
  </code></pre>
  
  <p>I am currently doing an <code>INNER JOIN</code>, which gives me three rows for the above instead of one:</p>
  
  <pre><code>SELECT * FROM title inner join territory on title.id = territory.title_id
  </code></pre>
  
  <p>How would I get it in the above output, where athere is a single row per title, and all territories are listed in that row?</p>