From a previous post, I have the following view in sqlite3:
CREATE View AttendeeTableView AS
SELECT (LastName || \" \" || FirstName) as AttendeeName,
I'm thinking a inner select might help, like:
CREATE View AttendeeTableView AS
SELECT (LastName || " " || FirstName) as AttendeeName,
(
select CompanyName
FROM Attendee A_innner
JOIN CompanyAttendeeRelation CAR /* is this where company name is? */
ON on CAR.AttendeeId = A.AttendeeId /* if not remove the joins and CAR */
WHERE A_inner.last_name = A_outer.last_name and
A_inner.first_name = A_outer.first_name
),
PhotoURI,
CAR.CompanyId,
CAR.AttendeeId
FROM Attendee A_outer
JOIN CompanyAttendeeRelation CAR_outer
ON on CAR_outer.AttendeeId = A_outer.AttendeeId
GROUP by LastName,FirstName
ORDER BY LastName, FirstName;