select * from a where id in
(select id from a group by id having count(1)=1)
------------select * from a where rowid in(
select max(rowid) from a group by col1)
(select id from a group by id having count(1)=1)
------------select * from a where rowid in(
select max(rowid) from a group by col1)
select * from 表 where rownum in (select max(rownum) from 表 group by 某字段)或:select * from 表 tem where rownum=(select max(rownum) from 表 where 某字段=tem.某字段)
select * from
(select a.*,row_number() over(partition by 某字段 order by rownum) rm from 表 a)
where rm=1;理论上,楼上快,最后利用执行计划测试