This course is currently a work in progress. Please join the waitlist to receive regular updates.

LIMIT keyword in SOQL

LIMIT keyword is used to limit the number of records returned. In an enterprise organization there will be thousants or millions of records and returning all records will hit the salesforce governor limit(50,000 records).

Limit keywords can optionally be added to SOQL queries to improve the performance.

The following is an examples of SOQL query using limit keyword.

Loading...

In the above example:

  • The LIMIT keyword is used to limit the query results.
  • The LIMIT keyword is followed by an integer number to limit the number of records.

Try It Yourself

Loading...