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

大小写混乱时的筛选统计

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

select用了个关联子查询(感觉好久没用了)

with t as (
    select tag,sum(count(*)) over w as answer_cnt,count(*) cnt
    from exam_record join examination_info using(exam_id)
    group by tag
    window w as (partition by upper(tag))
)
select t1.tag
    ,(select cnt from t as t2 where upper(t1.tag)=t2.tag) as answer_cnt
from t as t1
where answer_cnt-cnt>0 and cnt<3 and tag!=upper(tag)

全部评论

相关推荐

昨天 14:01
门头沟学院 golang
太难了,双9bg也被刷
投递韶音科技等公司10个岗位
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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