希望得到的数据结果是:
STUDENT_ID TEL CLASS_ID
---------- ----------- ------------
1 31184538 95785
2 31184538 95785
3 31978726 95785
4 31978726 95785
5 11504545 95785
6 11504545 95785
7 11504545 95785
STUDENT_ID TEL CLASS_ID
---------- ----------- ------------
1 31184538 95785
2 31184538 95785
3 31978726 95785
4 31978726 95785
5 11504545 95785
6 11504545 95785
7 11504545 95785
STUDENT_ID TEL CLASS_ID
---------- ----------- ------------
1 31184538 95785
2 31978726 95785
3 11504545 95785
或者
STUDENT_ID TEL CLASS_ID
---------- ----------- ------------
1 31184538 95785
3 31978726 95785
5 11504545 95785
sorry,急啊!:(
where rowid not in(
select max(rowid) from student
group by student_id,tel,class_id);
where
student_id in(select student_id from student group by student_id having count(student_id)>1)
and
rowid>(select min(rowid) from student group by student_id having count(student_id)>1)
where rowid not in(
select max(rowid) from student
group by tel,class_id);
STUDENT_ID TEL CLASS_ID
---------- ----------- ------------
1 31184538 95785
2 31184538 95785
3 31978726 95785
4 31978726 95785
5 11504545 95785
6 11504545 95785
7 11504545 95785
思路对头,非常感谢……
这下对了delete from student
where rowid not in(
select max(rowid) from student
group by tel,class_id);非常感谢大家的帮助,结贴!