select x.*,
	ceil(rnum / :lcnt) as pgno,
	0 chkval,
	max(rnum) over() as maxnum
from (
	select
		ROW_NUMBER() OVER (ORDER BY a.mcd) as rnum,
		a.mcd,
		a.mnm,
		a.sbat,
		a.bal
	from af484v01 a
	where a.ktktcd=:ktktcd
      and sbat=:sbat
) x
order by x.rnum
