select *
from (select t.*,row_number() over(partition by t.at_ab_id_n order by t.AT_SETTLE_DATE_D desc ) cn
from mypay_account_settle t where
t.at_ab_id_n=201001151300000002 and
to_char(t.at_tx_date_d,'yyyymmdd') <= &apl_date and
t.at_settle_type_c = '0001' )d
where cn = 1 order by d.at_tx_date_d desc;
row_number() over(order by col2 desc)用法
最新推荐文章于 2022-02-23 15:02:25 发布