题解 | 回答过教育类问题的用户里有多少用户回答过职场类问题

某乎问答回答过教育类问题的用户里有多少用户回答过职场类问题

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

# 3.22 9:17 ~ 25  8min

# 字段:num

# tb1:回答过教育类 且 回答过职场类  的用户数量
with tb1 as (
    select distinct author_id,issue_type
    from answer_tb left join issue_tb using(issue_id)
    where issue_type = 'Education' or issue_type = 'Career'

    order by author_id
),

# 结果查询
tb2 as(
    select author_id,count(issue_type) as num
    from tb1 
    group by author_id
    having num >= 2
)
select count(num) as num
from tb2

全部评论

相关推荐

努力成为C语言高手:质疑大祥老师,理解大祥老师,成为大祥老师
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务