Code: Select all
SELECT work_tickets.ticket_id, group_concat(work_tickets_assignment.assigned_to)
FROM work_tickets JOIN
work_tickets_assignment using(ticket_id)
GROUP BY work_tickets.ticket_id
Edit: While I believe this describes what you want it may not be the best choice depending on what you're trying to do. If you just want to view the results from the sql prompt that's probably fine. But if you're returning the results to your application it may be better to just wrap them up in there.