select s.* from student s where s_id in( select distinct s_id from score sc inner join( select c_id from course c inner join teacher t on c.t_id=t.t_id where t_name='张三' )t1 on sc.c_id=t1.c_id )
distinct 表示不重复的