|
发表于 2020-4-27 22:15:01
|
显示全部楼层
方法一、delete table where 学号(自动编号) not in
(select max(学号(自动编号)) as xh , 姓名 , 性别 , 年龄
from table
group by 姓名 , 性别 , 年龄) A
方法二、
delete table where 学号(自动编号) not in (
select max(a.学号) from table B,(select distinct 姓名 , 性别 , 年龄 from table ) A
where A.姓名=b.姓名 and a.性别=b.性别 and a.年龄 = b.年龄
) C
以上方法不知道是否可以,没有在SQL中测试。
|
|