现有一表,student
表中有id,class等属性
现要求取出所有同班级的人的姓名对.但不能重复,即取了A,B就不取B,A 
我写的是这样
select s1.id,s2.id from student s1,student s2 where s1.class =s2.class and s1.id!=s2.id
这样无法去掉重复. 另外这一题还要求用关系代数来写,该如何写 .也是无法去除重复的问题.望高手指教