oracle去重rowid和row_number()over()

select count(1) from pbwhsjb_0803 where rowid in (select rid
from (select rowid rid,
row_number() over(partition by a.base_crncy, a.crncy, a.security_typ, a.security_tenor_one, a.last_update_dt, a.last_update, a.fzsj, a.scsj order by a.jzsj desc) rn
from pbwhsjb_0803 a
where trunc(JZSJ) = date
'2021-07-31') b
where rn > 1);
原文地址:https://www.cnblogs.com/zhanglin123/p/15095196.html