WITH t1 as( SELECT ui.uid, SUM(IF(submit_time IS NULL,1,0)) AS incomplete_cnt, COUNT(start_time) AS total_cnt FROM user_info AS ui JOIN exam_record AS er ON ui.uid = er.uid GROUP BY ui.uid ), t2 as( SELECT ui.uid,level, IF(incomplete_cnt IS NULL,0,incomplete_cnt) AS incomplete_cnt, IF(total_cnt IS N...