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

大小写混乱时的筛选统计

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

with t as(
select exam_id,tag,count(start_time) as answer_cnt from exam_record left join examination_info using(exam_id) where upper(tag)!=tag group by 1 having answer_cnt <3),
t1 as (select exam_id,tag from exam_record left join examination_info using(exam_id) )

select t.tag as tag ,count(*) as answer_cnt from t inner join t1 on upper(t.tag)=t1.tag group by 1

全部评论
t表中的,where upper(tag)!=tag 为精髓所在,题中是指想筛选小写的tag
点赞 回复 分享
发布于 10-13 22:19 四川

相关推荐

评论
1
收藏
分享

创作者周榜

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