Quantcast
Channel: How do I limit the number of rows returned by an Oracle query after ordering? - Stack Overflow
Viewing all articles
Browse latest Browse all 17

Answer by arjun gaur for How do I limit the number of rows returned by an Oracle query after ordering?

$
0
0

I'v started preparing for Oracle 1z0-047 exam, validated against 12cWhile prepping for it i came across a 12c enhancement known as 'FETCH FIRST'It enables you to fetch rows /limit rows as per your convenience.Several options are available with it

- FETCH FIRST n ROWS ONLY - OFFSET n ROWS FETCH NEXT N1 ROWS ONLY // leave the n rows and display next N1 rows - n % rows via FETCH FIRST N PERCENT ROWS ONLY

Example:

Select * from XYZ aorder by a.pqrFETCH FIRST 10 ROWS ONLY

Viewing all articles
Browse latest Browse all 17

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>