17,377
社区成员
发帖
与我相关
我的任务
分享
--保留姓名最大的.
delete 学生表 from 学生表 t where a2 not in (select max(a2) from 学生表 where a1 = t.a1)
--保留姓名最小的.
delete 学生表 from 学生表 t where a2 not in (select min(a2) from 学生表 where a1 = t.a1)
delete from 学生表 where rowid not in (select min(rowid) from 学生表 group by 学号);