DBA Hub

📋Steps in this guide1/2

Row limiting clause in oracle 12c - DBACLASS DBACLASS

Row limiting clause clause allows sql queries to limit the number of rows returned and to specify a starting row for the return set. 1. Fetch first N rows: SQL> select * from test2 fetch first 5 rows only; OWNER OBJECT_NAME STATUS -------- --------------------- ------- SYS I_CCOL1 VALID SYS I_PROXY_ROLE_DATA$_1 VALID SYS C_OBJ# VALID SYS […]

oracle clusteringintermediate
by OracleDba
16 views
1

Overview

Row limiting clause clause allows sql queries to limit the number of rows returned and to specify a starting row for the return set. 1. Fetch first N rows: 2. Fetch 5 rows after offset of 4 rows

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
SQL> select * from test2 fetch first 5 rows only;

OWNER    OBJECT_NAME           STATUS
-------- --------------------- -------
SYS      I_CCOL1               VALID
SYS      I_PROXY_ROLE_DATA$_1  VALID
SYS      C_OBJ#                VALID
SYS      CON$                  VALID
SYS      I_USER1               VALID
2

Section 2

3. Fetch percentage of rows from a query:

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
SQL> select * from test2 a
OFFSET 4 ROWS FETCH NEXT 5 ROWS ONLY;  2

OWNER    OBJECT_NAME           STATUS
-------- --------------------- -------
SYS      I_USER1               VALID
SYS      COL$                  VALID
SYS      PROXY_DATA$           VALID
SYS      I_CON2                VALID
SYS      I_UNDO1               VALID

SELECT *  from test2  
FETCH FIRST 1 PERCENT ROWS ONLY;

Comments (0)

Please to add comments

No comments yet. Be the first to comment!