title: SQLITE: merging rows into single row if they share a column
body: <p>From a previous post, I have the following view in sqlite3:</p>
  
  <pre><code>CREATE View AttendeeTableView AS
  
  SELECT  (LastName || " " || FirstName) as AttendeeName,  
          CompanyName, 
          PhotoURI,
          CompanyAttendeeRelation.CompanyId,
          CompanyAttendeeRelation.AttendeeId 
  
  FROM    Attendee 
  JOIN    CompanyAttendeeRelation on CompanyAttendeeRelation.AttendeeId = Attendee.AttendeeId 
  
  ORDER BY LastName;
  </code></pre>
  
  <p>Now, since the data is generated from a many-to-many relation between <code>Attendee</code> and <code>Company</code>, I can get results such as:</p>
  
  <pre><code>Doe John | company A | johnPic.png | 1 | 15
  Doe John | company B | johnPic.png | 2 | 15
  </code></pre>
  
  <p>What I'd like to do is, in cases where there's more than one company (like above), create a query that outputs:</p>
  
  <pre><code>Doe John | company A company B | johnPic.png | 1 2 | 15
  </code></pre>
  
  <p>And another that outputs:</p>
  
  <pre><code>Doe John | company A | company B | johnPic.png | 1 | 2 | 15
  </code></pre>
  
  <p>So I need to know essentially how to merge a specific column for rows that have different
  values in that table. </p>
  
  <p>Any ideas?</p>
  
  <p>Just in case, <code>company A company B</code> in the first query is obviously text concatenation, That is, something along the lines of <code>(row1.CompanyName || " " || row2.CompanyName)</code> </p>