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);

 

posted @ 2021-08-03 17:14  rjm123456  阅读(93)  评论(0编辑  收藏  举报