i have table name = schedule
schedule
-------------------------------------------- | course_id | room | day | time | ---------------------------
You can use group_concat
select c.course_code, c.course_name, group_concat(concat(s.room, ',', s.day, '-', s.time) separator ';') from course c join schedule s on s.course_id = c.id group by c.course_code, c.course_name;