From the previous post, I have the following view in sqlite3:
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;
Now, since the data is generated from the many-to-many relationship between Attendee
and Company
, I can get results such as:
Doe John | company A | johnPic.png | 1 | 15 Doe John | company B | johnPic.png | 2 | 15
What would I like to do in cases where several companies (for example, above) create a query that displays:
Doe John | company A company B | johnPic.png | 1 2 | 15
And one more conclusion:
Doe John | company A | company B | johnPic.png | 1 | 2 | 15
Therefore, I need to know how to merge a specific column for rows that have different values ββin this table.
Any ideas?
Just in case, company A company B
in the first request is obviously a concatenation of text, that is, something like strings (row1.CompanyName || " " || row2.CompanyName)
source share