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