题解 | #月均完成试卷数不小于3的用户爱作答的类别#

月均完成试卷数不小于3的用户爱作答的类别

https://www.nowcoder.com/practice/b1d13efcfa0c4ecea517afbdb9090845

select m.tag,count(uid)tag_cnt

from

(select e.uid,e.submit_time,f.tag

from examination_info f ,exam_record e

where e.exam_id=f.exam_id )m

where m.uid in

(select h.uid from

(select c.uid,count(c.submit_time)c_s from

(select a.uid,a.submit_time,b.tag

from examination_info b ,exam_record a

where a.exam_id=b.exam_id and a.submit_time is not null and month(start_time)=9)c

group by c.uid 

having count(c.submit_time)>=3)h)

group by m.tag

order by tag_cnt desc;

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

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