LIMIT clause
The LIMIT clause is used to limit the number of records returned by a query. It is particularly useful when you want to retrieve a specific number of records from a table.
Syntax
Examples
The LIMIT clause followed by 1 is often used along with the ONLY clause to satisfy the requirement that only up to a single record can be returned.
Use in pagination
When using the LIMIT clause, it is possible to paginate results by using the START clause to start from a specific record from the result set. It is important to note that the START count starts from 0.
This pattern is most often used through SDKs to avoid sending messages that exceed a certain size to other pieces of software, and so on.
The following pseudocode demonstrates the most common pattern seen when START and LIMIT are used together.