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.bal,
		a.pay,
		a.sal,
		a.tax,
		a.sal + a.tax amt,
		a.bsal
	from af481v02 a
	where a.wseq=:wseq
) x
order by x.rnum
