供参考: select t3.course_id 课程id, t3.user_id 用户ID, u.user_full_name 姓名, -- u.phone, concat(u.company,' ',ex.user_enterprise) 公司或企业, t3.right_1 权限状态, t3.right_0 退款数, t3.exit_date 退款日期 from ( select course_id, user_id, sum(right_1) right_1, sum(right_0) r…