删除重复记录,留下最近插入的数据:
delete from A_TEST b where exists(select 1 from A_TEST a where a.name=b.name and a.age=b.age and a.id>b.id);
删除重复记录,留下最早插入的数据:
delete from A_TEST b where exists(select 1 from A_TEST a where a.name=b.name and a.age=b.age and a.id<b.id);