select a.staff_id,s.staff_name
from (select *,right(course,7) as co
from cultivate_tb) a left join staff_tb s on a.staff_id=s.staff_id
where a.co='course3'

用right是纯粹的投机取巧。

SELECT s.staff_id, s.staff_name

FROM staff_tb s

INNER JOIN cultivate_tb c ON s.staff_id = c.staff_id

WHERE c.course LIKE '%course3%'

ORDER BY s.staff_id ASC;

正解是使用like