题解 | 大小写混乱时的筛选统计
大小写混乱时的筛选统计
https://www.nowcoder.com/practice/81cb12931a604811ae69d332515c7734
SELECT MAX( tag ) tag, MAX( answer_cnt ) answer_cnt FROM ( SELECT MAX( er.exam_id ) exam_id, ei.tag tag, COUNT( 1 ) answer_cnt FROM exam_record er INNER JOIN examination_info ei ON er.exam_id = ei.exam_id GROUP BY tag ) t GROUP BY UPPER( tag ) HAVING COUNT( exam_id )> 1 ORDER BY answer_cnt DESC