条件:2021年每个未完成试卷作答数大于1的有效用户的数据(有效用户指完成试卷作答数至少为1且未完成数小于5) 2021年用where where YEAR(start_time) = 2021 未完成试卷作答数:无submit_time或者无score。用if函数。 select sum(if(submit_time is null, 1, 0)) as incomplete_cnt , sum(if(submit_time is null, 0, 1)) as complete_cnt 有效用户:完成试卷作答数至少为1且未完成数小于5。用having做筛选。 having ...