select t1.id , t1.t_class , t1.teacherfrom t_class t1 left join (select * from t_class where id=1) t2 on t1.t_class = t2.t_class and t1.id = t2.idwhere t2.id is null
图1 为:表数据
图2为:表结构
图3为:查询结果