题解 | #统计所有课程参加培训人次#
统计所有课程参加培训人次
https://www.nowcoder.com/practice/98aad5807cf34a3b960cc8a70ce03f53
with a as( select * ,case when course like '%1%' then 1 else 0 end as course1 ,case when course like '%2%' then 1 else 0 end as course2 ,case when course like '%3%' then 1 else 0 end as course3 from cultivate_tb ) select (sum(course1)+sum(course2)+sum(course3)) as staff_nums from a