Try the following:
Code:
select *
from ( select ROW_NUMBER() OVER(ORDER BY SNum) AS row, SNum
from atm.asnum
where UPPER(SNum)=UPPER('atal')) t
where row between 2 and 20
(I.e., I added the alias "t" for the nested table expression.)
B.t.w., are you sure that SNum is a textual column?
Maybe you need to explicitly cast it to VARCHAR(64) or something before applying UPPER to it.