题解 | 统计所有课程参加培训人次 逗号数量+1就是这个人培训课程数

统计所有课程参加培训人次

https://www.nowcoder.com/practice/98aad5807cf34a3b960cc8a70ce03f53

select sum(course_count) as staff_nums
from (
    select staff_id,
    case 
        when course is null then 0
        else (length(course) - length(replace(course, ',', '')) + 1)
    end as course_count
    from cultivate_tb
) as a;

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

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