I think you want the users with the most recent createdon
first. Assuming createon
is the same for all users, try:
select *
from (select dense_rank() over (order by createdon desc, userid asc) as rowno
from emp
) tab
where rowno >= 1 and rowno <= 10
order by Createdon desc;