|  | 
| select distinct id from CLASSTAB a where not  exists( select subject from CLASSTAB where id=1
 minus
 select subject from CLASSTAB where id=a.id)
 and id <> 1;
 
 可以
 
 select subject from CLASSTAB where id=1
 minus
 select subject from CLASSTAB where id=a.id;
 
 结果为空,可找出结果集包含id=1时的情况,外包一个not exists,就是非空的结果集
 | 
 |