In earlier version we have used row_num filter in where clause to limit the number of rows getting fetched. In oracle 18c,
the new command, SET ROWLIMIT command enables users to set a limit for the number of rows displayed for a query.

By default it is set to OFF.

— For limiting number or rows to 5.

SQL> set rowlimit 5
SQL> select username from dba_users;

USERNAME
——————————————————-
SYS
SYSTEM
XS$NULL
OJVMSYS
LBACSYS

5 rows selected. (rowlimit reached)

— For limiting number or rows to 5.

SQL> set rowlimit 2
SQL> select username from dba_users;

USERNAME
——————————————————-
SYS
SYSTEM

2 rows selected. (rowlimit reached)