题解 | #统计所有课程参加培训人次#
统计所有课程参加培训人次
https://www.nowcoder.com/practice/98aad5807cf34a3b960cc8a70ce03f53
with t as( select staff_id, if(course like '%1%',1,0) as course1, if(course like '%2%',1,0) as course2, if(course like '%3%',1,0) as course3 from cultivate_tb where course is not null) select sum(course1)+sum(course2)+sum(course3) as staff_nums from t