看题解基本都没用到with写法的,在这里放上本人用with ... as写法完成的sql,个人认为比大多数sql会比较好理解。每一部分的含义在sql中都有注释! with user_info_filter as( select uid from user_info where level = 6 or level = 7 ), --获取等级在6和7的用户uid exam_filter as( select uid, count(DISTINCT DATE_FORMAT(start_time,'%Y%m%d')) as act_days_2021_exam from exam_record w...