FETCH FIRST

In Oracle SQL, the LIMIT clause is not used. Instead, you can achieve similar functionality using the FETCH FIRST clause or the ROWNUM pseudo column. Here are examples of both approaches:

USING FETCH FIRST

USING ROWNUM

The first example uses the FETCH FIRST clause, which is a part of the SQL:2008 standard and is supported by Oracle.

The second example uses a subquery with the ROWNUM condition. The ROWNUM condition is applied before the outer query retrieves the rows, so it effectively limits the result set.

EXAMPLE USING FETCH FIRST AND OFFSET

INTERESTING EXAMPLE

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top