How to select records with duplicate just one field and all other field value?

后端 未结 1 1818
别跟我提以往
别跟我提以往 2021-01-28 02:36

i have table name = schedule

 --------------------------------------------
| course_id | room |   day  |     time     |
---------------------------         


        
相关标签:
1条回答
  • 2021-01-28 02:52

    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;
    
    0 讨论(0)
提交回复
热议问题