Created
February 4, 2020 22:43
-
-
Save naranjja/e17947f398c6fd7c48a271ee6b7417b5 to your computer and use it in GitHub Desktop.
Get last N_ROWS and sort ascending afterwards in Oracle 11.g
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select * | |
from ( | |
select * | |
from TABLE | |
order by SORT_COLUMN desc | |
) temp | |
where rownum <= N_ROWS | |
order by SORT_COLUMN asc; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment