1. 程式人生 > >Oracle去重留下一條資料

Oracle去重留下一條資料

select * from 表 a where (a.Id,a.seq) in (select Id,seq from 表 group by Id,seq having count(*) > 1) and rowid not in (select min(rowid) from 表 group by Id,seq having count(*)>1)