select x.*,
	ceil(rnum / :lcnt) as pgno,
	0 chkval,
	max(rnum) over() as maxnum
from (
	select
		ROW_NUMBER() OVER (ORDER BY a.cucd) as rnum,
		a.cucd,
		a.cunm,
		a.sbat,
		a.bal
	from af482v01 a
	where a.ktktcd=:ktktcd
      and smon=to_date(:dat,'yyyy/mm')
) x
order by x.rnum
