select staff_id,staff_name
from
(
select s.staff_id,staff_name,course from staff_tb as s
join 
(
select staff_id,course from cultivate_tb
) as c
on s.staff_id = c.staff_id
where right(course,1) = 3
) as t1