SELECT SUM(course1) + SUM(course2) +SUM(course3) AS staff_nums FROM (SELECT info_id,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) AS a