SQL Statements and Extensions for the Salesforce Driver : Select : Select Clause : Limit Clause

Limit Clause
Purpose
The Limit clause places an upper bound on the number of rows returned in the result.
Syntax
LIMIT number_of_rows [OFFSET offset_number]
where:
number_of_rows
Specifies a maximum number of rows in the result. A negative number indicates no upper bound.
OFFSET
Specifies how many rows to skip at the beginning of the result set. offset_number is the number of rows to skip.
Notes
Example
The following example returns a maximum of 20 rows.
SELECT last_name, first_name FROM emp WHERE salary > 20000 ORDER BY dept_id LIMIT 20

© 2013 Progress Software Corporation and/or its subsidiaries or affiliates.