select stu_id,stu_name from t_student a
where a.stu_id in (
select distinct b.stu_id from t_score b where b.stu_id=a.stu_id)
改成这样即可:
select stu_id,stu_name
from t_student a
where a.stu_id not in
(select b.stu_id from t_score b );
你这个是 not exists,只能改成not in。绝大多数情况下,不要将not exists改为not in。NOT IN的性能差多了