Skip to main content

LIMIT

The LIMIT clause can be used to limit the number of rows being selected. This is often used in conjunction with the ORDER BY clause to perform Top N (or Bottom N) analysis.

In SQL Frames the LIMIT operation can be performed using the df.limit() API.

Loading...
Performance considerations

In SQL Frames most clauses of the SELECT statement result in creating a separate DataFrame. However, the LIMIT operation does not create a separate DataFrame. Hence, in order to limit the data for a specific query and not impact rest of the queries that depend on it, a DataFrame can be first projected using df.pdf() and then the limit can be applied.