SELECT er.uid, SUM(IF (er.submit_time IS NULL, 1, 0)) AS incomplete_cnt, COUNT(er.submit_time) AS complete_cnt, GROUP_CONCAT(DISTINCT CONCAT(DATE_FORMAT(er.start_time, '%Y-%m-%d'), ':', ei.tag) ORDER BY er.start_time SEPARATOR ';') AS detail FROM exam_record er JOIN examination_info ...