SELECT * FROM ( select row_number() over(partition by account_no order by trading_date DESC ) as n,
account_no ,trading_date,balance from rc_account_trans_tb where 1=1
) T WHERE T.n='1'
SELECT * FROM ( select row_number() over(partition by account_no order by trading_date DESC ) as n,
account_no ,trading_date,balance from rc_account_trans_tb where 1=1
) T WHERE T.n='1'