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

大小写混乱时的筛选统计

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)

全部评论

相关推荐

能干的三文鱼刷了10...:公司可能有弄嵌入式需要会画pcb的需求,而且pcb能快速直观看出一个人某方面的实力。看看是否有面试资格。问你问题也能ai出来,pcb这东西能作假概率不高
点赞 评论 收藏
分享
湫湫湫不会java:先投着吧,大概率找不到实习,没实习的时候再加个项目,然后把个人评价和荣誉奖项删了,赶紧成为八股战神吧,没实习没学历,秋招机会估计不多,把握机会。或者说秋招时间去冲实习,春招冲offer,但是压力会比较大
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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