I have a table attendee, when joining table attendee with table Session, attendee can attend many sessions. So when showing the attendees and what sessions they attended, I am getting multiple rows of the same Attendee, example :
John Doe-BMW Conference
John Doe-Blockchain conference
Jane Doe-blabla
John Doe- Mercedess
Is there a way in sql to display
John Doe- BMW Conference,Mercedes,Block chain?
SELECT Distinct
attendee.Id, attendee.Firstname, attendee.PhoneNumber,
attendee.Email,attendee.Town, attendee.BloodType, session.Id ,
session.LocationId , session.Name as SessionName , location.Id ,
location.Name as Location_Name , sessionattended.SessionAttendedId,
sessionattended.SessionId, sessionattended.AttendeeId,
attendee.Lastname
FROM `session`, `attendee`, `sessionattended`, `location`
WHERE attendee.Id = sessionattended.AttendeeId
and session.Id = sessionattended.SessionId
and session.LocationId = location.Id;