题解 | #大小写混乱时的筛选统计#

大小写混乱时的筛选统计

http://www.nowcoder.com/practice/81cb12931a604811ae69d332515c7734

要用满足完成数小于3的小写tag去匹配对应大写tag的数量!!!醉了
select t1.tag,t2.answer_cnt
from (
            select tag 
            from exam_record t1
            join examination_info t2
            on t1.exam_id = t2.exam_id
            where upper(tag) <> tag
            group by tag
            having count(1) < 3
    ) t1
join  (
        select tag,count(1) as answer_cnt
        from exam_record t1
        join examination_info t2
        on t1.exam_id = t2.exam_id
        group by tag
        ) t2
on upper(t1.tag) = t2.tag
order by answer_cnt desc



全部评论
为啥我在t1,t2表内连之后再group by 结果就是错的呢?
点赞 回复 分享
发布于 2023-08-01 11:07 北京

相关推荐

notbeentak...:孩子,说实话,选择很重要,可能你换一个方向会好很多,但是现在时间不太够了,除非准备春招
点赞 评论 收藏
分享
评论
7
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务