Mysql
 sql >> Base de données >  >> RDS >> Mysql

mysql - groupe, mais affiche toutes les lignes d'une colonne

utilisez GROUP_CONCAT

SELECT  staff.name,
        staff.designation_id_designation,
        staff.status_id_status,
        GROUP_CONCAT(Concat_Ws('=', leave_remain.leave_type_id_leave_type, leave_remain.days)) AS remain
FROM    staff 
        INNER JOIN leave_remain 
            ON staff.id_staff = leave_remain.staff_id_staff
GROUP   BY staff.name, staff.designation_id_designation, staff.status_id_status  

autre(s) lien(s)