题解 | 统计所有课程参加培训人次
统计所有课程参加培训人次
https://www.nowcoder.com/practice/98aad5807cf34a3b960cc8a70ce03f53
select
sum(label_1)+sum(label_2)+sum(label_3) as staff_nums
from
(
select
info_id,
staff_id,
course,
#为每个课程打标
case
when course like '%1%' then 1
else 0
end as label_1,
case
when course like '%2%' then 1
else 0
end as label_2,
case
when course like '%3%' then 1
else 0
end as label_3
from cultivate_tb
) t


